Last active
May 4, 2022 15:35
-
-
Save shawndumas/5c5b4b3a0b26802c0fee to your computer and use it in GitHub Desktop.
GUID
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
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