Skip to content

Instantly share code, notes, and snippets.

@awran5
Last active September 11, 2021 20:42
Show Gist options
  • Save awran5/5328ea319f4bab58428f794f98c8766c to your computer and use it in GitHub Desktop.
Save awran5/5328ea319f4bab58428f794f98c8766c to your computer and use it in GitHub Desktop.
Get random string uuid like
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