File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,9 @@ let randomInt;
88try { // to use Node.js module
99 ( { randomInt } = require ( 'crypto' ) ) ;
1010} catch ( err ) { // use browser API or JS method
11- const webCrypto = window . crypto || window . msCrypto ;
11+ const browserCrypto = window . crypto || window . msCrypto ;
1212 randomInt = ( min , max ) => {
13- const randomVal = webCrypto ?. getRandomValues ( new Uint32Array ( 1 ) ) [ 0 ] / 0xFFFFFFFF || Math . random ( ) ;
13+ const randomVal = browserCrypto ?. getRandomValues ( new Uint32Array ( 1 ) ) [ 0 ] / 0xFFFFFFFF || Math . random ( ) ;
1414 return Math . floor ( randomVal * ( max - min ) ) + min ;
1515 } ;
1616}
Original file line number Diff line number Diff line change @@ -9,9 +9,9 @@ try { // to use Node.js module
99 ( { randomInt } = require ( 'crypto' ) ) ;
1010} catch ( err ) { // use browser API or JS method
1111 console . error ( 'could not iport crcypto' ) ;
12- const webCrypto = window . crypto || window . msCrypto ;
12+ const browserCrypto = window . crypto || window . msCrypto ;
1313 randomInt = ( min , max ) => {
14- const randomVal = webCrypto ?. getRandomValues ( new Uint32Array ( 1 ) ) [ 0 ] / 0xFFFFFFFF || Math . random ( ) ;
14+ const randomVal = browserCrypto ?. getRandomValues ( new Uint32Array ( 1 ) ) [ 0 ] / 0xFFFFFFFF || Math . random ( ) ;
1515 return Math . floor ( randomVal * ( max - min ) ) + min ;
1616 } ;
1717}
You can’t perform that action at this time.
0 commit comments