mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 11:45:49 +00:00
style: run eslint formatter
This commit is contained in:
@@ -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))
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user