Last active
May 16, 2019 07:23
-
-
Save eczn/6cf624b453941ee662b2a273529af2a7 to your computer and use it in GitHub Desktop.
JS Get A Short Random Id
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
export function getRandomId() { | |
return Date.now().toString(36); | |
} | |
export function getRandomId2() { | |
return Math.random().toString(36).slice(2); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment