You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since [modern browsers](https://caniuse.com/mdn-api_crypto_randomuuid) support `crypto.randomUUID()` we make use of it when generating UUIDs. This patch does the following:
- Shaves ~160 bytes off the browser bundle
- Modern platforms bail out quickly with `crypto.randomUUID()`
- Less modern browsers (including IE11 and Safari < v15.4) use `crypto.getRandomValues()`
- Node.js
- `< v15` uses `Math.random()`
- `v15 > v16.7 uses` `crypto.getRandomValues()`
- `>= v16.7 uses` `crypto.randomUUID()`
- Validated that all code paths do in fact return valid uuidv4 ids with hyphens removed!
- Added tests to test all different kinds of random value and uuid creation
0 commit comments