Skip to content

Instantly share code, notes, and snippets.

@arekbartnik
Forked from 6174/Random-string
Last active February 20, 2020 15:16
Show Gist options
  • Save arekbartnik/114c2eb049482db610df33ddf3a6ac25 to your computer and use it in GitHub Desktop.
Save arekbartnik/114c2eb049482db610df33ddf3a6ac25 to your computer and use it in GitHub Desktop.
Generate a random string in JavaScript In a short and fast way!
[...Array(10)].map(i=>(~~(Math.random()*36)).toString(36)).join('')
(Math.random()*0xFFFFFF<<0).toString(16);
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment