Skip to content

Instantly share code, notes, and snippets.

@brettski
Created October 27, 2021 16:18
Show Gist options
  • Save brettski/f696706e5c73a8a5020acc74835dc1ce to your computer and use it in GitHub Desktop.
Save brettski/f696706e5c73a8a5020acc74835dc1ce to your computer and use it in GitHub Desktop.
Randomize alpha-numeric string
return Math.random()
.toString(36)
.substr(2, 6)
.toUpperCase(); // e.g. 'CM2JUR'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment