Skip to content

Instantly share code, notes, and snippets.

@audinue
Created September 17, 2020 16:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save audinue/97498a5117f945044f0898a8d512f1da to your computer and use it in GitHub Desktop.
Save audinue/97498a5117f945044f0898a8d512f1da to your computer and use it in GitHub Desktop.
const uid = () => [...crypto.getRandomValues(new Uint8Array(16))]
.map(x => '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'.charAt(x % 62))
.join('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment