File tree Expand file tree Collapse file tree 4 files changed +17
-52
lines changed
packages/ethereum-cryptography Expand file tree Collapse file tree 4 files changed +17
-52
lines changed Original file line number Diff line number Diff line change 49
49
" pure/**/*.d.ts.map"
50
50
],
51
51
"browser" : {
52
- "./keccak.js" : " ./pure/keccak.js" ,
53
52
"./scrypt.js" : " ./pure/scrypt.js" ,
54
53
"./ripemd160.js" : " ./pure/ripemd160.js" ,
55
54
"./secp256k1.js" : " ./pure/secp256k1.js" ,
128
127
"create-hmac" : " ^1.1.7" ,
129
128
"elliptic" : " ^6.4.1" ,
130
129
"hash.js" : " ^1.1.7" ,
131
- "js-sha3 " : " ^0.8 .0" ,
130
+ "keccak " : " ^3.0 .0" ,
132
131
"pbkdf2" : " ^3.0.17" ,
133
132
"randombytes" : " ^2.1.0" ,
134
133
"safe-buffer" : " ^5.1.2" ,
Original file line number Diff line number Diff line change 1
- import * as keccakPure from "./pure/keccak " ;
1
+ import { createHashFunction } from "./hash-utils " ;
2
2
3
- let keccakModule : typeof keccakPure ;
3
+ const createKeccakHash = require ( "keccak" ) ;
4
4
5
- try {
6
- // tslint:disable-next-line no-implicit-dependencies
7
- keccakModule = require ( "ethereum-cryptography-native/keccak" ) ;
8
- } catch {
9
- keccakModule = require ( "./pure/keccak" ) ;
10
- }
5
+ export const keccak224 = createHashFunction ( ( ) =>
6
+ createKeccakHash ( "keccak224" )
7
+ ) ;
11
8
12
- export const keccak224 = keccakModule . keccak224 ;
13
- export const keccak256 = keccakModule . keccak256 ;
14
- export const keccak384 = keccakModule . keccak384 ;
15
- export const keccak512 = keccakModule . keccak512 ;
9
+ export const keccak256 = createHashFunction ( ( ) =>
10
+ createKeccakHash ( "keccak256" )
11
+ ) ;
12
+
13
+ export const keccak384 = createHashFunction ( ( ) =>
14
+ createKeccakHash ( "keccak384" )
15
+ ) ;
16
+
17
+ export const keccak512 = createHashFunction ( ( ) =>
18
+ createKeccakHash ( "keccak512" )
19
+ ) ;
Load Diff This file was deleted.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments