style: run eslint formatter

This commit is contained in:
Elliot Lee
2021-02-22 14:09:14 -08:00
parent 9fafdf1449
commit 4b228842df
2 changed files with 4 additions and 17 deletions

View File

@@ -26,11 +26,7 @@ function generateSeed(
} }
function hash(message): number[] { function hash(message): number[] {
return hashjs return hashjs.sha512().update(message).digest().slice(0, 32)
.sha512()
.update(message)
.digest()
.slice(0, 32)
} }
const secp256k1 = { const secp256k1 = {
@@ -44,10 +40,7 @@ const secp256k1 = {
const prefix = '00' const prefix = '00'
const privateKey = const privateKey =
prefix + prefix + derivePrivateKey(entropy, options).toString(16, 64).toUpperCase()
derivePrivateKey(entropy, options)
.toString(16, 64)
.toUpperCase()
const publicKey = bytesToHex( const publicKey = bytesToHex(
Secp256k1.keyFromPrivate(privateKey.slice(2)) Secp256k1.keyFromPrivate(privateKey.slice(2))

View File

@@ -17,15 +17,9 @@ function hexToBytes(a): number[] {
} }
function computePublicKeyHash(publicKeyBytes: Buffer): Buffer { function computePublicKeyHash(publicKeyBytes: Buffer): Buffer {
const hash256 = hashjs const hash256 = hashjs.sha256().update(publicKeyBytes).digest()
.sha256()
.update(publicKeyBytes)
.digest()
const hash160 = hashjs const hash160 = hashjs.ripemd160().update(hash256).digest()
.ripemd160()
.update(hash256)
.digest()
return Buffer.from(hash160) return Buffer.from(hash160)
} }