Created
January 28, 2022 16:54
-
-
Save hayleyxyz/4fc985c12c9cdcd32064b54ec644a1a8 to your computer and use it in GitHub Desktop.
dumb lowercase alphanumeric random string generator.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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