Created
April 4, 2016 13:49
-
-
Save reganstarr/60757b2b3a66412a22011ceba1a189b3 to your computer and use it in GitHub Desktop.
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
| // adapted from http://stackoverflow.com/a/1349426/5573841 | |
| function generateRandomString(desiredLengthOfRandomString) { | |
| var result = ''; | |
| var possibleCharactersForRandomString = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
| for( var i=0; i < desiredLengthOfRandomString; i++ ) | |
| result += possibleCharactersForRandomString.charAt(Math.floor(Math.random() * possibleCharactersForRandomString.length)); | |
| return result; | |
| } | |
| var randomString = generateRandomString(32); | |
| var output = {'randomString': randomString}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks 👍