Created
November 27, 2024 15:23
-
-
Save itsundef/663d5d308c46cea8d1a84f2c6842d6c0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function generateUUID() { | |
return "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (e => { | |
const t = 16 * Math.random() | 0; | |
return ("x" === e ? t : 3 & t | 8).toString(16) | |
} | |
)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment