Universal randomUUID — works in browsers (modern), Node 19+, Bun, Deno
via the Web Crypto API. Falls back to a Math.random-based RFC4122 v4
generator for older runtimes (non-cryptographic).
The lib used to import randomUUID from node:crypto, which broke
browser bundles (Module "crypto" has been externalized for browser compatibility). This shim removes that build-time dependency.
Universal
randomUUID— works in browsers (modern), Node 19+, Bun, Deno via the Web Crypto API. Falls back to a Math.random-based RFC4122 v4 generator for older runtimes (non-cryptographic).The lib used to import
randomUUIDfromnode:crypto, which broke browser bundles (Module "crypto" has been externalized for browser compatibility). This shim removes that build-time dependency.