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[] {
return hashjs
.sha512()
.update(message)
.digest()
.slice(0, 32)
return hashjs.sha512().update(message).digest().slice(0, 32)
}
const secp256k1 = {
@@ -44,10 +40,7 @@ const secp256k1 = {
const prefix = '00'
const privateKey =
prefix +
derivePrivateKey(entropy, options)
.toString(16, 64)
.toUpperCase()
prefix + derivePrivateKey(entropy, options).toString(16, 64).toUpperCase()
const publicKey = bytesToHex(
Secp256k1.keyFromPrivate(privateKey.slice(2))

View File

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