File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -33,20 +33,7 @@ function escapeUnsafeChars(unsafeChar) {
3333}
3434
3535function generateUID ( ) {
36- var bytes ;
37- if ( typeof crypto !== 'undefined' && typeof crypto . getRandomValues === 'function' ) {
38- bytes = crypto . getRandomValues ( new Uint8Array ( UID_LENGTH ) ) ;
39- } else {
40- try {
41- var nodeCrypto = require ( 'crypto' ) ;
42- bytes = nodeCrypto . randomBytes ( UID_LENGTH ) ;
43- } catch {
44- // We'll throw an error later
45- }
46- }
47- if ( ! bytes ) {
48- throw new Error ( 'Secure random number generation is not supported by this platform.' ) ;
49- }
36+ var bytes = crypto . getRandomValues ( new Uint8Array ( UID_LENGTH ) ) ;
5037 var result = '' ;
5138 for ( var i = 0 ; i < UID_LENGTH ; ++ i ) {
5239 result += bytes [ i ] . toString ( 16 ) ;
Original file line number Diff line number Diff line change 2626 "homepage" : " https://github.com/yahoo/serialize-javascript" ,
2727 "devDependencies" : {
2828 "benchmark" : " ^2.1.4"
29+ },
30+ "engines" : {
31+ "node" : " >=20.0.0"
2932 }
3033}
You can’t perform that action at this time.
0 commit comments