Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
11–20 of 236 posts
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#12Unrelated, but this links to "Crockford's alphabet", https://www.crockford.com/base32.html , which is a base-32 system that includes all alphanumeric characters except I and L (which are confusable with 1), O (which is confusable with 0), and U (????). The page says the reason for excluding U is "accidental obscenity'. What the heck is it talking about?
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#13And in my experience most people somehow think a UUID must be stored into the human friendly hex representation, dashes included. Wasting so much space in database, network, memory.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#14I have some complaints about UUIDs. Why not just combining time + random number without the ceremony of UUID versioning. And for when locality doesn't matter, just use a 128bit random number directly. And in my experience most people somehow think a UUID must be stored into the human friendly hex representation, dashes included. Wasting so much space in database, network, memory.
You can't guarantee that this will be globally unique.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#15Naive Question: The type safe part is just appending a string at the beginning? What if I do that with UUIDv4? is user_49b9cd12-9964-4b9c-8512-742f0a2c9be4 type safe now?
For example, the PostgresSQL implementation of TypeID, would let you use a "domain type" to define a typeid subtype. Thus ensuring that the database itself always checks the validity of the type prefix. An example is here: https://github.com/jetpack-io/typeid-sql/blob/main/example/e...
In go, we're considering it making it easy to define a new Go type, that enforces a particular type prefix. If you can do that, then the Go type system would enforce you are passing the correct type of id.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#16Earlier quoted context omitted.
FUCK
yep, youtube video ids has/had? same issue where it would have things like fag/f4g etc in it. eg: google "allinurl:fag site:youtube.com"
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#17So it's got all of the above perks, but it also an actual UUID and fits in a Postgres UUID column.
It's very cool to be able to resolve a UUID to a particular database table and record with almost zero performance overhead (cached table lookup + indexed record select).
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#18I have some complaints about UUIDs. Why not just combining time + random number without the ceremony of UUID versioning. And for when locality doesn't matter, just use a 128bit random number directly. And in my experience most people somehow think a UUID must be stored into the human friendly hex representation, dashes included. Wasting so much space in database, network, memory.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#19Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#20Unrelated, but this links to "Crockford's alphabet", https://www.crockford.com/base32.html , which is a base-32 system that includes all alphanumeric characters except I and L (which are confusable with 1), O (which is confusable with 0), and U (????). The page says the reason for excluding U is "accidental obscenity'. What the heck is it talking about?