Created
June 13, 2017 09:01
-
-
Save evolutionxbox/4907ab33bde06cd08ad53769bc27b2df to your computer and use it in GitHub Desktop.
Simple Unique ID Generator (well, not entirely unique...)
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 generateUniqueID() { | |
function chr4(){ | |
return Math.random().toString(16).slice(-4); | |
} | |
return chr4() + chr4() + | |
'-' + chr4() + | |
'-' + chr4() + | |
'-' + chr4() + | |
'-' + chr4() + chr4() + chr4(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment