Created
August 12, 2018 15:47
-
-
Save strangerintheq/a548100e14e3998a11e51472197d52be to your computer and use it in GitHub Desktop.
random string generator
This file contains hidden or 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
module.exports = function(i) { | |
var rnd = ''; | |
while (rnd.length < i) { | |
rnd += Math.random().toString(36).substring(2); | |
} | |
return rnd.substring(0, i); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment