File tree Expand file tree Collapse file tree 3 files changed +3
-22
lines changed
packages/ethereum-cryptography Expand file tree Collapse file tree 3 files changed +3
-22
lines changed Original file line number Diff line number Diff line change 57
57
"./sha256.js" : " ./pure/sha256.js" ,
58
58
"./hdkey.js" : " ./pure/hdkey.js" ,
59
59
"./blake2b.js" : " ./pure/blake2b.js" ,
60
- "./random.js" : " ./pure/random.js" ,
61
60
"./bip39/index.js" : " ./pure/bip39/index.js"
62
61
},
63
62
"sideEffects" : false ,
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- import crypto from "crypto" ;
1
+ const randombytes = require ( "randombytes" ) ;
2
2
3
3
export function getRandomBytes ( bytes : number ) : Promise < Buffer > {
4
4
return new Promise ( ( resolve , reject ) => {
5
- crypto . randomBytes ( bytes , function ( err : any , resp : Buffer ) {
5
+ randombytes ( bytes , function ( err : any , resp : Buffer ) {
6
6
if ( err ) {
7
7
reject ( err ) ;
8
8
return ;
@@ -14,5 +14,5 @@ export function getRandomBytes(bytes: number): Promise<Buffer> {
14
14
}
15
15
16
16
export function getRandomBytesSync ( bytes : number ) : Buffer {
17
- return crypto . randomBytes ( bytes ) ;
17
+ return randombytes ( bytes ) ;
18
18
}
You can’t perform that action at this time.
0 commit comments