Generate unique id in javascript

A Unique Hexatridecimal ID generator. It will always create unique id’s based on the current time, process and machine name.

We install the npm package for create unique id

Usage:

Output:

uniqid( prefix optional string , suffix optional string )

Generate 18 byte unique id’s based on the time, process id and mac address. Works on multiple processes and machines.

uniqid.process( prefix optional string , suffix optional string )

Generate 12 byte unique id’s based on the time and the process id. Works on multiple processes within a single machine but not on multiple machines.

uniqid.time( prefix optional string , suffix optional string )

Generate 8 byte unique id’s based on the current time only. Recommended only on a single process on a single machine.

 

Was this post helpful?
Let us know if you liked the post. That’s the only way we can improve.
Yes0
No0
Harinder Singh

Harinder Singh

My name is Harinder Singh and I specialize in Software industry. I consider myself as a life learner. I love learning new concepts, embracing new ideas and reading and searching for innovation.