-
-
Save ianstarz/2c35a0c286f692462457 to your computer and use it in GitHub Desktop.
GUID
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 guid = function fn (n) { | |
return n ? | |
(n ^ Math.random() * 16 >> n/4).toString(16) : | |
('10000000-1000-4000-8000-100000000000'.replace(/[018]/g, fn)); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment