Skip to content

Instantly share code, notes, and snippets.

@JosePedroDias
Created March 9, 2015 10:50
Show Gist options
  • Save JosePedroDias/9e6c18cb9a753edc17bd to your computer and use it in GitHub Desktop.
Save JosePedroDias/9e6c18cb9a753edc17bd to your computer and use it in GitHub Desktop.
random base32 string of length len. works well up to 6 characters. chars are in the range [0-9][a-t]
function rndBase32(len) {
return ( ~~(Math.random() * Math.pow(32, len)) ).toString(32);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment