Created
January 10, 2019 22:36
-
-
Save noudadrichem/96cf9f1d36c13e242a2abf5bd889891c to your computer and use it in GitHub Desktop.
Returns a id string with a timestamp in it
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
const timestamp = (new Date().getTime() / 1000 | 0).toString(16); | |
const uniqueTimeStampId = (stamp) => stamp + 'xxxxxxxxxxxxxxxx'.replace(/[x]/g, () => (Math.random() * 16 | 0).toString(16)).toLowerCase() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment