Last active
March 21, 2024 13:43
-
-
Save AnandPilania/b97b8fe32406ea8920f3b488389a4dad to your computer and use it in GitHub Desktop.
UUID Generator
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const generateUUID = () => | |
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => { | |
var r = Math.random() * 16 | 0; | |
return (c == "x" ? r : (r & 0x3 | 0x8)).toString(16); | |
}); | |
$1 = generateUUID(); | |
$2 = generateUUID(); | |
$3 = generateUUID(); | |
$4 = generateUUID(); | |
$5 = generateUUID(); | |
$6 = generateUUID(); | |
console.table([$1, $2, $3, $4, $5, $6]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment