typeid

#OpenSource

Product information

TypeID is a type-safe, K-sortable, globally unique identifier inspired by Stripe IDs. It extends the UUIDv7 standard by incorporating a type prefix, making it easier to identify the type of entity a TypeID refers to. A TypeID is canonically encoded as a lowercase string with three parts: a type prefix (up to 63 characters in lowercase snake_case ASCII), an underscore separator, and a 128-bit UUIDv7 encoded as a 26-character string using a modified base32 encoding. This encoding is URL safe, case-insensitive, avoids ambiguous characters, and is more compact than traditional hex encoding.

TypeIDs are designed to be type-safe, ensuring that you cannot mistakenly use an identifier for one entity type in place of another. They are also K-sortable, making them suitable for use as primary keys in databases while maintaining good locality. TypeIDs are fully compatible with UUIDs; decoding a TypeID and removing the type information yields a valid UUIDv7.

Jetify provides an online converter to switch between UUIDs and TypeIDs, and there are official implementations in Go, SQL, and TypeScript, with community contributions in various other languages. Additionally, a command-line tool is available for generating and decoding TypeIDs.

Pricing

Pricing information is not available