Last active
August 29, 2015 14:01
-
-
Save icodesido/67ac273c9917956d4546 to your computer and use it in GitHub Desktop.
Generate random 5 char string
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 makeId() | |
| { | |
| var txt = "", | |
| rand = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
| for (var i = 5; i >= 0; i--) { | |
| txt += rand.charAt(Math.floor(Math.random() * rand.length)); | |
| } | |
| return txt; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment