Created
December 5, 2016 14:02
-
-
Save ishanjain28/074f50f6f3743d66db7acf3708ef2c45 to your computer and use it in GitHub Desktop.
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
function generateRandomString(length) { | |
var string = ""; | |
var possibleValues = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
for(var i = 0; i < length; i++) { | |
string += possibleValues.charAt(Math.floor(Math.random() * possibleValues.length)); | |
} | |
return string; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment