Created
January 13, 2021 07:03
-
-
Save roshanca/9b53d3d51b00362464be361f7907519e to your computer and use it in GitHub Desktop.
generate random id
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 generateInstanceID() { | |
const a = "abcdefghijklmnopqrstuv"; | |
const l = a.length; | |
const t = Date.now(); | |
const r = [0, 0, 0].map(d => a[Math.floor(Math.random() * l)]).join(""); | |
return `${r}${t}`; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment