Created
February 21, 2018 13:53
-
-
Save ultimagriever/d9a48538feb878c7ce8b65ca7aab597a 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
function generateRandomString(length = 32) { | |
let hash = ''; | |
for (let i = 0; i < length; i++) { | |
hash += (Math.floor(Math.random() * 16)).toString(16); | |
} | |
return hash; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment