Implementing

Variants

View this section in the spec ↗

The 2 TNID variant bits select how the 100 payload bits are read, as the version does for a UUID.

TNID variantBitsSimilar toPayload
TNIDv00b00UUIDv743-bit ms timestamp + 57 random bits; time-sortable
TNIDv10b01UUIDv4100 random bits
TNIDv20b10Reserved
TNIDv30b11Reserved

Reserved variants

No definition yet, so nothing to generate. Parsers SHOULD accept them, so TNIDs from a future spec version round-trip through older code. Treat the payload as opaque.

Which to use: Choosing a variant.

  1. 01 TNIDv0: time-sortableTNIDv0 stores a 43-bit millisecond timestamp and 57 random bits, so TNIDs sort by creation time.
  2. 02 TNIDv1: randomTNIDv1 fills all 100 payload bits with random data, like UUIDv4.