Last active
November 11, 2017 18:25
-
-
Save marekcech/ac66a683700129bca0143ed232aa9bbc to your computer and use it in GitHub Desktop.
Piece of JS which generates random-ID with lenght 10 symbols
This file contains hidden or 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
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