Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save hayleyxyz/4fc985c12c9cdcd32064b54ec644a1a8 to your computer and use it in GitHub Desktop.
Save hayleyxyz/4fc985c12c9cdcd32064b54ec644a1a8 to your computer and use it in GitHub Desktop.
dumb lowercase alphanumeric random string generator.js
const rnd = (len) => {
let ret = '';
while(ret.length < len) {
ret += Math.floor(Math.random() * Math.pow(36, Math.min(len, 32))).toString(36);
}
return ret.substring(0, len);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment