Secure UUIDs In Node
You can use the function as follows:
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.
If you don’t care whether your UUIDs often collide, you can use the following code: