Last active
September 11, 2021 20:42
-
-
Save awran5/5328ea319f4bab58428f794f98c8766c to your computer and use it in GitHub Desktop.
Get random string uuid like
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
function getRandomId() { | |
return Array.from(window.crypto.getRandomValues(new Uint32Array(4))) | |
.map((number) => number.toString(16)) | |
.join('-') | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment