We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 6dd24c7 + 15b80fb commit 1e965b1Copy full SHA for 1e965b1
test/sandbox/public/turbo.es2017-esm.js
@@ -499,16 +499,17 @@ function interpolate(strings, values) {
499
}
500
501
function uuid() {
502
+ const randomValues = crypto.getRandomValues(new Uint8Array(36));
503
return Array.from({ length: 36 })
504
.map((_, i) => {
505
if (i == 8 || i == 13 || i == 18 || i == 23) {
506
return "-"
507
} else if (i == 14) {
508
return "4"
509
} else if (i == 19) {
- return (Math.floor(Math.random() * 4) + 8).toString(16)
510
+ return ((randomValues[i] % 4) + 8).toString(16)
511
} else {
- return Math.floor(Math.random() * 15).toString(16)
512
+ return (randomValues[i] % 16).toString(16)
513
514
})
515
.join("")
0 commit comments