Summary
Node v26.1.0 added crypto.randomUUIDv7([options]), which returns an RFC 9562 version 7 UUID string with a millisecond Unix timestamp in the most significant 48 bits and cryptographically secure random bits in the remaining fields.
Perry currently implements crypto.randomUUID([options]) for UUID v4, but there is no committed source path for randomUUIDv7.
Evidence
- Current Node docs list
crypto.randomUUIDv7([options]), added in v26.1.0: https://nodejs.org/api/crypto.html#cryptorandomuuidv7options
docs/runtime-parity.md:1211-1212 lists crypto.randomUUID([options]) as covered and crypto.randomUUIDv7([options]) as a newer partial API.
docs/runtime-parity-gaps.md:578 retains crypto.randomUUIDv7([options]) in the crypto gap list.
crates/perry-hir/src/lower/expr_call/crypto.rs:89 documents only randomUUID() lowering to Expr::CryptoRandomUUID.
- Source search finds
randomUUIDv7 only in docs, while randomUUID() has existing HIR/codegen/test coverage.
- No manifest row or native-module symbol path exists for
crypto.randomUUIDv7.
Expected behavior
Perry should expose a Node-compatible UUID v7 helper:
const crypto = require('node:crypto');
const id = crypto.randomUUIDv7();
console.log(typeof id); // "string"
console.log(id.length); // 36
console.log(id[14]); // "7"
The implementation should follow RFC 9562 UUID v7 layout, use a millisecond timestamp in the high bits, set version/variant bits correctly, fill the remaining fields with cryptographically secure randomness, and accept the same disableEntropyCache option shape as Node.
Duplicate check
I searched issues and PRs for randomUUIDv7, crypto.randomUUIDv7, and UUID v7. I did not find an existing tracker. Existing crypto issues cover stream transforms/key import-export (#2479/#2480), top-level Argon2/KEM APIs (#2517), and WebCrypto algorithm coverage (#2518), but not UUID v7 generation.
I could not run a fresh local Perry reproduction in this checkout because no built perry binary is present; this is based on committed source, parity metadata, current Node docs, and issue/PR search.
Summary
Node v26.1.0 added
crypto.randomUUIDv7([options]), which returns an RFC 9562 version 7 UUID string with a millisecond Unix timestamp in the most significant 48 bits and cryptographically secure random bits in the remaining fields.Perry currently implements
crypto.randomUUID([options])for UUID v4, but there is no committed source path forrandomUUIDv7.Evidence
crypto.randomUUIDv7([options]), added in v26.1.0: https://nodejs.org/api/crypto.html#cryptorandomuuidv7optionsdocs/runtime-parity.md:1211-1212listscrypto.randomUUID([options])as covered andcrypto.randomUUIDv7([options])as a newer partial API.docs/runtime-parity-gaps.md:578retainscrypto.randomUUIDv7([options])in the crypto gap list.crates/perry-hir/src/lower/expr_call/crypto.rs:89documents onlyrandomUUID()lowering toExpr::CryptoRandomUUID.randomUUIDv7only in docs, whilerandomUUID()has existing HIR/codegen/test coverage.crypto.randomUUIDv7.Expected behavior
Perry should expose a Node-compatible UUID v7 helper:
The implementation should follow RFC 9562 UUID v7 layout, use a millisecond timestamp in the high bits, set version/variant bits correctly, fill the remaining fields with cryptographically secure randomness, and accept the same
disableEntropyCacheoption shape as Node.Duplicate check
I searched issues and PRs for
randomUUIDv7,crypto.randomUUIDv7, andUUID v7. I did not find an existing tracker. Existing crypto issues cover stream transforms/key import-export (#2479/#2480), top-level Argon2/KEM APIs (#2517), and WebCrypto algorithm coverage (#2518), but not UUID v7 generation.I could not run a fresh local Perry reproduction in this checkout because no built
perrybinary is present; this is based on committed source, parity metadata, current Node docs, and issue/PR search.