File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change 66// IMPORT secure crypto RNG
77let randomInt ;
88try { // to use Node.js module
9- randomInt = require ( 'crypto' ) . randomInt ;
9+ ( { randomInt } = require ( 'crypto' ) ) ;
1010} catch ( err ) { // use browser API or JS method
1111 const webCrypto = window . crypto || window . msCrypto ;
1212 randomInt = ( min , max ) => {
Original file line number Diff line number Diff line change 66// IMPORT secure crypto RNG
77let randomInt ;
88try { // to use Node.js module
9- randomInt = require ( 'crypto' ) . randomInt ;
9+ ( { randomInt } = require ( 'crypto' ) ) ;
1010} catch ( err ) { // use browser API or JS method
11+ console . error ( 'could not iport crcypto' ) ;
1112 const webCrypto = window . crypto || window . msCrypto ;
1213 randomInt = ( min , max ) => {
1314 const randomVal = webCrypto ?. getRandomValues ( new Uint32Array ( 1 ) ) [ 0 ] / 0xFFFFFFFF || Math . random ( ) ;
You can’t perform that action at this time.
0 commit comments