type-alias / @typed/id/Uuid7

Uuid7Seed

The validated time, sequence, and entropy used to format one UUID version 7.

Package version
1.0.0-beta.7
Category
Sequence state
Since
1.0.0

Import

import { Uuid7Seed } from "@typed/id/Uuid7";

Signatures

export type Uuid7Seed = {
    readonly timestamp: number;
    readonly seq: number;
    readonly randomBytes: Uint8Array & {
        length: 16;
    };
};

Why

An explicit seed documents the exact inputs to version and variant bit layout and makes generator state testable.

Ownership and lifetime

This data acquires no resources; the producing service owns sequence state and transfers a fresh random byte array.

Property: randomBytes

Fresh entropy buffer whose final bytes complete the UUID payload.

Property: seq

Unsigned 32-bit sequence integer in the range [0, 0xffffffff].

Property: timestamp

Validated millisecond timestamp encoded into the UUID.

Examples

import type { Uuid7Seed } from "@typed/id/Uuid7"
const seed: Uuid7Seed = { timestamp: 0, seq: 0, randomBytes: new Uint8Array(16) as Uuid7Seed["randomBytes"] }

Other public imports

These import paths expose the same declaration. Each page retains its own public name and signature.

Source