Skip to content

Instantly share code, notes, and snippets.

@srounce
Created July 21, 2014 10:58
Show Gist options
  • Select an option

  • Save srounce/51ef26251833af12766c to your computer and use it in GitHub Desktop.

Select an option

Save srounce/51ef26251833af12766c to your computer and use it in GitHub Desktop.
random alpha numeric string
function randomString(length) {
var str = "";
length = length || 1;
while(str.length < length) {
str += (Math.round(Math.random() * 36)).toString(36)
}
return str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment