This repository was archived by the owner on Nov 24, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-17
lines changed
Expand file tree Collapse file tree 2 files changed +4
-17
lines changed Original file line number Diff line number Diff line change @@ -26,11 +26,7 @@ function generateSeed(
2626}
2727
2828function 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
3632const 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 ) )
Original file line number Diff line number Diff line change @@ -17,15 +17,9 @@ function hexToBytes(a): number[] {
1717}
1818
1919function 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
You can’t perform that action at this time.
0 commit comments