logoalt Hacker News

sublinearyesterday at 11:02 AM1 replyview on HN

> We're using this: https://www.npmjs.com/package/uuid

Why? There's a built-in for this.

https://nodejs.org/api/crypto.html#cryptorandomuuidoptions


Replies

OptionOfTyesterday at 5:10 PM

That's what the package uses. And if `crypto.randomUUID()` doesn't exist, it falls back to `crypto.getRandomValues()`, which per the documentation isn't AS strong:

https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getR...

So by using the package you actually lose visibility of cases where `crypto.randomUUID()` would fail.

show 1 reply