Skip to content

Instantly share code, notes, and snippets.

@marekcech
Last active November 11, 2017 18:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marekcech/ac66a683700129bca0143ed232aa9bbc to your computer and use it in GitHub Desktop.
Save marekcech/ac66a683700129bca0143ed232aa9bbc to your computer and use it in GitHub Desktop.
Piece of JS which generates random-ID with lenght 10 symbols
function() {
return new Date().getTime() + '.' + Math.random().toString(36).substring(10);
}
// node.js
function() {
return new Date().now() + '.' + Math.random().toString(36).substring(5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment