File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed
src/provider/chains/algo/sdk Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change 67
67
"ethereumjs-util" : " ^7.1.4" ,
68
68
"hi-base32" : " ^0.5.1" ,
69
69
"js-conflux-sdk" : " ^1.7.1" ,
70
+ "js-sha512" : " ^0.8.0" ,
70
71
"timeout-signal" : " ^1.1.0" ,
71
72
"tweetnacl" : " ^1.0.3" ,
72
73
"whatwg-url" : " ^11.0.0"
Original file line number Diff line number Diff line change 1
1
/* Copyright (c) 2019 Algorand, llc */
2
2
3
- import * as crypto from 'crypto' ;
4
-
3
+ import sha512 from 'js-sha512' ;
5
4
import nacl from 'tweetnacl' ;
6
5
7
- export function genericHash ( arr : crypto . BinaryLike ) : Uint8Array {
8
- return new Uint8Array ( crypto . createHash ( ' sha512-256' ) . update ( arr ) . digest ( ) ) ;
6
+ export function genericHash ( arr : sha512 . Message ) {
7
+ return sha512 . sha512_256 . array ( arr ) ;
9
8
}
10
9
11
10
// constants
Original file line number Diff line number Diff line change 4017
4017
resolved "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840"
4018
4018
integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==
4019
4019
4020
+ js-sha512@^0.8.0 :
4021
+ version "0.8.0"
4022
+ resolved "https://registry.yarnpkg.com/js-sha512/-/js-sha512-0.8.0.tgz#dd22db8d02756faccf19f218e3ed61ec8249f7d4"
4023
+ integrity sha512-PWsmefG6Jkodqt+ePTvBZCSMFgN7Clckjd0O7su3I0+BW2QWUTJNzjktHsztGLhncP2h8mcF9V9Y2Ha59pAViQ==
4024
+
4020
4025
js-tokens@^4.0.0 :
4021
4026
version "4.0.0"
4022
4027
resolved "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
You can’t perform that action at this time.
0 commit comments