Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions types/node/crypto.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3157,6 +3157,13 @@ declare module "node:crypto" {
* @since v15.6.0, v14.17.0
*/
function randomUUID(options?: RandomUUIDOptions): UUID;
/**
* Generates a random [RFC 9562](https://www.rfc-editor.org/rfc/rfc9562.txt) 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.
* @since v26.1.0
*/
function randomUUIDv7(options?: RandomUUIDOptions): UUID;
interface X509CheckOptions {
/**
* @default 'always'
Expand Down
7 changes: 7 additions & 0 deletions types/node/node-tests/crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1607,6 +1607,13 @@ import { promisify } from "node:util";
crypto.randomUUID();
}

{
crypto.randomUUIDv7({});
crypto.randomUUIDv7({ disableEntropyCache: true });
crypto.randomUUIDv7({ disableEntropyCache: false });
crypto.randomUUIDv7();
}

{
const cert = new crypto.X509Certificate("dummy");
cert.ca; // $ExpectType boolean
Expand Down