diff --git a/doc/api/crypto.md b/doc/api/crypto.md index fb80671b8bd8a6..55b948aac50db5 100644 --- a/doc/api/crypto.md +++ b/doc/api/crypto.md @@ -5826,6 +5826,25 @@ added: Generates a random [RFC 4122][] version 4 UUID. The UUID is generated using a cryptographic pseudorandom number generator. +### `crypto.randomUUIDv7([options])` + + + +* `options` {Object} + * `disableEntropyCache` {boolean} By default, to improve performance, + Node.js generates and caches enough + random data to generate up to 128 random UUIDs. To generate a UUID + without using the cache, set `disableEntropyCache` to `true`. + **Default:** `false`. +* Returns: {string} + +Generates a random [RFC 9562][] version 7 UUID. The UUID contains a millisecond +precision Unix timestamp in the most significant 48 bits, followed by +cryptographically secure random bits for the remaining fields, making it +suitable for use as a database key with time-based sorting. + ### `crypto.scrypt(password, salt, keylen[, options], callback)`