3 ms·
UUID v4 seems to be based on random numbers, so should be "as good" as whatever scheme they were trying to hand roll here. Additionally, the uuid npm library us
by tolmasky 11y ago
UUID v4 seems to be based on random numbers, so should be "as good" as whatever scheme they were trying to hand roll here. Additionally, the uuid npm library uses crypto.randomBytes, which is cryptographically secure.
https://github.com/broofa/node-uuid https://github.com/broofa/node-uuid
- mmalone 11y agoThe biggest problem is that they take up a lot of space. Plus you have to find a good library and vet it (there's nothing in the standard library). Or just write 10 lines of straightforward code. If you go and look at node-uuid commit history it, too, used Math.random() back in the day.