Last active
March 20, 2024 07:21
-
-
Save jmas/220dfd1a8aff64f977cfd6c1e889d6d9 to your computer and use it in GitHub Desktop.
uniqid.js
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
/** | |
* If IDs are generated more than 1 millisecond apart, they are 100% unique. | |
* @url https://stackoverflow.com/a/44078785 | |
* @returns String | |
*/ | |
function uniqid() { | |
return Date.now().toString(36) + Math.random().toString(36).substring(2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment