Expand description
Random identifiers in the layout of the incumbent’s randomUUID.
What:
Random identifiers in the layout of the incumbent’s randomUUID:
lock tokens,
transaction IDs and stale-name suffixes.
Why:
A lock token must be unguessable and unique per acquisition,
and a transaction ID
names a registry directory that the incumbent accepts only in the canonical layout
(isTransactionId in src/policy-engine/commit-transaction-registry.ts).
In TS you’d write (pseudocode):
import { randomUUID } from 'node:crypto'; const token = randomUUID();Structs§
- Random
Source Error - What: Why no identifier could be made: the operating system’s random source failed. Why: Without randomness no unguessable token exists, so the caller must stop.
Functions§
- format_
uuid_ v4 - What:
Format 16 bytes as a version-4 UUID in canonical lowercase layout.
[u8; 16]is a fixed array of sixteen bytes. Why: RFC 9562 version 4: the version nibble is 4 and the variant bits are10, exactly whatrandomUUIDproduces; the formatting is pure so tests can fix the input. - random_
uuid - What:
A fresh random version-4 UUID from the operating system’s source.
Result<String, RandomSourceError>is “the identifier, or why not”. Why: Tokens and transaction IDs must not be predictable or collide between processes.