Expand description
Shared UUIDv7 identifier generation with strict 1ms spacing.
This generator is used by both the subtitle translation engine (for cue
IDs) and the media discovery layer (for file IDs). Generating UUIDv7 IDs
in batch order means the embedded unix_time_ts (the most-significant 48
bits) reflects request order and can be inspected from logs without
consulting external state.
This module enforces an additional constraint on top of the UUIDv7
algorithm: adjacent ID generations are spaced by at least 1 millisecond,
so each next ID’s unix_time_ts is strictly greater than the previous
one. This avoids same-millisecond ambiguity that the standard UUIDv7
algorithm normally resolves through random or monotonic counter bits.
Structs§
- Uuidv7
Generator - Stateful UUIDv7 ID generator shared by media discovery and translation.
Functions§
- generate_
ids - Generate
countUUIDv7 IDs in sequence with strict 1ms spacing. - unix_
time_ ms - Extract the 48-bit
unix_time_tsfield from a UUIDv7 value.