MCPcopy Index your code
hub / github.com/nodejs/node / getBufferedUUIDv7

Function getBufferedUUIDv7

lib/internal/crypto/random.js:429–439  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

427}
428
429function getBufferedUUIDv7() {
430 uuidData ??= secureBuffer(16 * kBatchSize);
431 if (uuidData === undefined)
432 throw new ERR_OPERATION_FAILED('Out of memory');
433
434 if (uuidBatch === 0) randomFillSync(uuidData);
435 uuidBatch = (uuidBatch + 1) % kBatchSize;
436 const offset = uuidBatch * 16;
437 writeTimestamp(uuidData, offset);
438 return serializeUUID(uuidData, 0x70, 0x80, offset);
439}
440
441function getUnbufferedUUIDv7() {
442 uuidNotBuffered ??= secureBuffer(16);

Callers 1

randomUUIDv7Function · 0.85

Calls 3

randomFillSyncFunction · 0.85
writeTimestampFunction · 0.85
serializeUUIDFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…