Skip to content

Instantly share code, notes, and snippets.

@noudadrichem
Created January 10, 2019 22:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save noudadrichem/96cf9f1d36c13e242a2abf5bd889891c to your computer and use it in GitHub Desktop.
Save noudadrichem/96cf9f1d36c13e242a2abf5bd889891c to your computer and use it in GitHub Desktop.
Returns a id string with a timestamp in it
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