Created
December 1, 2016 11:35
-
-
Save solancer/d0196af85c024b612e901d0b6163ff5c to your computer and use it in GitHub Desktop.
Random id 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 randIdGen() { | |
| var text = ""; | |
| var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; | |
| for( var i=0; i < 5; i++ ) | |
| text += possible.charAt(Math.floor(Math.random() * possible.length)); | |
| return '#' + text; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment