Created
July 22, 2013 22:25
-
-
Save zakdances/6058266 to your computer and use it in GitHub Desktop.
CoffeeScript implementation of http://stackoverflow.com/a/16693578/697190
This file contains 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
generateUniqueID = () -> | |
_p8 = (s) -> | |
p = (Math.random().toString(16)+"000000000").substr(2,8) | |
if s then "-" + p.substr(0,4) + "-" + p.substr(4,4) else p | |
_p8() + _p8(true) + _p8(true) + _p8() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment