Guide
For people using TNIDs in an application.
Why TNIDs
- Typed: the type name is in the bits; code rejects the wrong kind at runtime, type checkers at compile time.
- Sortable: sorting the strings as text sorts the TNIDs by value; time-sortable TNIDv0s sort by creation time.
- Readable:
user.Br2flcNDfF6LYICnTnames what it identifies.
Backwards compatible with UUIDs: every TNID is one.
Where to go
- Just want to start: pick your language on Libraries, then see Basic operations for the four operations you'll use.
- Deciding whether to adopt: What a TNID is → Compared with other IDs → Using TNIDs where UUIDs are expected.
- Writing a library: Implementing.
TNID is a draft (version 0); libraries are pre-1.0.
- 01 What a TNID isA TNID is a 128-bit ID that carries a short name saying what kind of thing it identifies, and is backwards compatible with UUIDs.
- 02 Basic operationsThe four things every TNID library does: define a type per name, generate, show and store, and parse.
- 03 NamesThe rules for TNID names, and how to choose names that stay readable and stable.
- 04 Choosing a variantWhen to use TNIDv0 (time-sortable), when to use TNIDv1 (random), and how to combine them.
- 05 Type safetyHow TNID names become part of a TNID's type, so passing the wrong kind of TNID is a compile error.
- 06 Storing and showing TNIDsThe forms a TNID can be written in, and a practical default: store it in UUID form, show it as a TNID string.
- 07 Hiding creation time and unwanted wordsHow the optional encryption and blocklist filtering extensions hide TNIDv0 timestamps and keep unwanted words out of TNIDs.
- 08 Using TNIDs where UUIDs are expectedWhat stays the same and what is different when TNIDs go into columns, APIs and tools built for UUIDs.
- 09 Compared with other IDsHow TNIDs compare with UUIDv4, UUIDv7, ULID, KSUID, TypeID, and prefixed UUID strings, and when to use another ID format instead.