Created
July 3, 2020 13:01
-
-
Save etc-tiago/61fa641da16f2f366f5583f67e0bc0eb to your computer and use it in GitHub Desktop.
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 ID = function () { | |
// Math.random should be unique because of its seeding algorithm. | |
// Convert it to base 36 (numbers + letters), and grab the first 9 characters | |
// after the decimal. | |
const start = Math.random().toString(36).substr(2, 2); | |
const end = Math.random().toString(36).substr(2, 2); | |
return '_' + start + end; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment