Generates a random RFC 4122 version 4 UUID. The UUID is generated using a cryptographic pseudorandom number generator.
function
crypto.randomUUID
): `${string}-${string}-${string}-${string}-${string}`;
Referenced types
interface RandomUUIDOptions
- disableEntropyCache?: boolean
By default, to improve performance, Node.js will pre-emptively generate and persistently cache enough random data to generate up to 128 random UUIDs. To generate a UUID without using the cache, set
disableEntropyCachetotrue.