jetify-com/typeid: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
github.comΒ·1d
πŸ¦•Deno
Preview
Report Post

TypeID

A type-safe, K-sortable, globally unique identifier inspired by Stripe IDs

What is it?

TypeIDs are a modern, type-safe extension of UUIDv7. Inspired by a similar use of prefixes in Stripe’s APIs.

TypeIDs are canonically encoded as lowercase strings consisting of three parts:

  1. A type prefix (at most 63 characters in all lowercase snake_case ASCII [a-z_]).
  2. An underscore β€˜_’ separator
  3. A 128-bit UUIDv7 encoded as a 26-character string using a modified base32 encoding.

Here’s an example of a TypeID of type user:

user_2x4y6z8a0b1c2d3e4f5g6h7j8k
β””β”€β”€β”˜ β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
type    uuid suffix (base32)

A formal specification defines the encoding in more detail.

Online Converter

…

Similar Posts

Loading similar posts...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help