makeToken(10);
Last active
March 4, 2016 02:26
-
-
Save Elevista/0667ead18b99947642c0 to your computer and use it in GitHub Desktop.
make random token
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
;(()=> { | |
var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; | |
this.makeToken = n => { | |
var arr = []; | |
for (var i = 0; i < n; i++) | |
arr.push(chars.charAt(Math.floor(Math.random() * chars.length))); | |
return arr.join(''); | |
}; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment