File tree Expand file tree Collapse file tree 1 file changed +1
-13
lines changed
WebServerAI/assets/AI/js/components Expand file tree Collapse file tree 1 file changed +1
-13
lines changed Original file line number Diff line number Diff line change @@ -6,19 +6,7 @@ class Extensions{
66 this . ext = { } ;
77 }
88 #extensionID( ) {
9- // Create a buffer to hold random bytes
10- const randomBytes = new Uint8Array ( 16 ) ;
11- // Fill the buffer with cryptographically secure random values
12- window . crypto . getRandomValues ( randomBytes ) ;
13-
14- // Replace the placeholders in the UUID template with random hexadecimal characters
15- const uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx' . replace ( / [ x y ] / g, function ( c ) {
16- // Use random bytes to generate hexadecimal digits
17- const r = randomBytes [ Math . floor ( Math . random ( ) * randomBytes . length ) ] ;
18- // Replace 'x' with a random digit and 'y' with a specific digit (4 for UUID version 4)
19- return ( c === 'x' ? ( r & 0x0f ) : ( r & 0x3 | 0x8 ) ) . toString ( 16 ) ;
20- } ) ;
21-
9+ const uuid = window . crypto . randomUUID ( ) ;
2210 return uuid ;
2311 }
2412 /**
You can’t perform that action at this time.
0 commit comments