Skip to content
This repository was archived by the owner on Nov 24, 2021. It is now read-only.

Commit dcedf7c

Browse files
committed
style: run eslint formatter
1 parent f69be78 commit dcedf7c

File tree

2 files changed

+4
-17
lines changed

2 files changed

+4
-17
lines changed

src/index.ts

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,7 @@ function generateSeed(
2626
}
2727

2828
function hash(message): number[] {
29-
return hashjs
30-
.sha512()
31-
.update(message)
32-
.digest()
33-
.slice(0, 32)
29+
return hashjs.sha512().update(message).digest().slice(0, 32)
3430
}
3531

3632
const secp256k1 = {
@@ -44,10 +40,7 @@ const secp256k1 = {
4440
const prefix = '00'
4541

4642
const privateKey =
47-
prefix +
48-
derivePrivateKey(entropy, options)
49-
.toString(16, 64)
50-
.toUpperCase()
43+
prefix + derivePrivateKey(entropy, options).toString(16, 64).toUpperCase()
5144

5245
const publicKey = bytesToHex(
5346
Secp256k1.keyFromPrivate(privateKey.slice(2))

src/utils.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,9 @@ function hexToBytes(a): number[] {
1717
}
1818

1919
function computePublicKeyHash(publicKeyBytes: Buffer): Buffer {
20-
const hash256 = hashjs
21-
.sha256()
22-
.update(publicKeyBytes)
23-
.digest()
20+
const hash256 = hashjs.sha256().update(publicKeyBytes).digest()
2421

25-
const hash160 = hashjs
26-
.ripemd160()
27-
.update(hash256)
28-
.digest()
22+
const hash160 = hashjs.ripemd160().update(hash256).digest()
2923
return Buffer.from(hash160)
3024
}
3125

0 commit comments

Comments
 (0)