Secure UUIDs In Node
Category: Node.js
Usage
You can use the function as follows:
Explanation
You could theoretically also create UUIDs yourself. There is only one issue, however: UUIDs tend to collide when not created with the correct approach.
So, if you don’t want UUID collisions, you should rely on the crypto module to create UUIDs for you.
Alternative
If you don’t care whether your UUIDs often collide, you can use the following code: