Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ID - a unique ID/name generator for JavaScript
// Do not use. Use Symbol() instead.
@mohitsharma93
Copy link

mohitsharma93 commented Nov 22, 2021

what about this
return new Date().getTime().toString(36).concat(performance.now().toString(), Math.random().toString()).replace(/\./g,"");

@komiljon4717
Copy link

komiljon4717 commented Dec 2, 2021

Thanks

@swapnil-sudhir
Copy link

swapnil-sudhir commented Apr 1, 2022

Can anyone reduce the length of the string by 5-6 Characters still maintaining the collision factor ?

@was-coder
Copy link

was-coder commented Apr 4, 2022

Tha

what about this return new Date().getTime().toString(36).concat(performance.now().toString(), Math.random().toString()).replace(/\./g,"");

Thanks this was helpful

@DaEnder
Copy link

DaEnder commented Sep 18, 2022

Arthur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment