File tree 1 file changed +6
-5
lines changed
static/extensions/steve0greatness
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 1
1
/**
2
2
* @overview
3
3
*
4
- * Defines the "Extra Timers" extension for PenguinMod.
4
+ * Allows for the creation and management of additional timers in PenguinMod.
5
5
*
6
6
* @license MIT
7
7
* @author Steve0Greatness
@@ -16,11 +16,12 @@ const selfid = "steve0greatnesstimers";
16
16
function uid_clone ( ) {
17
17
const soup = "!#%()*+,-./:;=?@[]^_`{|}~ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789" ;
18
18
const length = 20 ;
19
+
20
+ const max = num => ( num & 127 ) >= soup . length ? ( num & 127 ) - soup . length : ( num & 127 ) ;
19
21
20
- return Array . from (
21
- { length } ,
22
- _ => soup . charAt ( Math . random ( ) * soup . length )
23
- ) . join ( "" ) ;
22
+ return [ ...crypto . getRandomValues ( new Uint8Array ( length ) ) ]
23
+ . map ( ( e ) => soup . charAt ( max ( e ) ) )
24
+ . join ( "" ) ;
24
25
}
25
26
26
27
function xml_escape ( unsafe ) {
You can’t perform that action at this time.
0 commit comments