Neat! Love the "type-safe" prefix; we'd called them "tagged ids" in our ORM that auto-prefixes the otherwise-ints-in-the-db with similar per-entity tags: https://joist-orm.io/docs/advanced/tagged-ids We'd used `:` as our delimiter, but kinda regretting not using `_` because of the "double-click to copy/paste" aspect... In theory it'd be really easy to get Joist to take "uuid columns in the db" and turn them into "typ…
Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
51–60 of 236 posts
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#52An important aspect of identifiers is to not leak any information in the identifier. In some scenarios a prefix might be fine but less important things have been blocked by our dpo department.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#53what does k-sortable mean?
This property is useful for RDBMS writes, when the UUID is used as a primary key and this locality ensures that fewer slotted pages need to be modified to write the same amount of data.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#54Earlier quoted context omitted.
Ideally, you should version that as UUIDv8. Since that is a more custom implementation, but I guess changing the random bits with type info works fine for UUIDv7, they jsut arent random anymore.
Not every bit of UUID is required to be random. The goals are smallness, uniqueness, monotonicity, resistance to enumeration attacks, etc. Not randomness for randomness sake. My UUIDv7+ can be consumed as a standard UUIDv7. It is not intended to be v8. A program can treat the last 16 bits as random noise if it wants.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#55Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#56Earlier quoted context omitted.
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"
You can prevent any obscenity, O and 0 confusion, and I and L confusion, just by excluding vowels. If someone interprets "f4g" in an offensive way, then they have bigger issues than can be dealt with in software.
Even programming language have them. For instance, Basic has GOTO.
/j
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#57https://github.com/swyxio/brain/blob/master/R%20-%20Dev%20No...
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#58what does k-sortable mean?
That if a hundred servers are generating (uuid, timestamp) tuples that are subsequently merged on a single machine, and sorted by uuid, it would have almost the same order as if sorted by timestamp. This property is useful for RDBMS writes, when the UUID is used as a primary key and this locality ensures that fewer slotted pages need to be modified to write the same amount of data.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#59Let's say I have structs:
type User struct { ID TypeID }
type Post struct { ID TypeID }
How can I ensure the correct type is used in each of the structs?
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#60Earlier quoted context omitted.
You can prevent any obscenity, O and 0 confusion, and I and L confusion, just by excluding vowels. If someone interprets "f4g" in an offensive way, then they have bigger issues than can be dealt with in software.
There was that time Delta generated an "H8GAYS" PNR. [1] Pretty sure that's valid Crockford encoding too :) however, to your point, it does rely on 'A'. "H8G4YS" would likely still offend someone out there, though, given the kerfuffle in [1]. [1] https://newsfeed.time.com/2013/12/17/delta-airlines-is-very-...
Oh sweet summer child (meaning Jeff White, not OP/GP). As someone who has implemented a censorship/filtering list, this is a UX problem on the same level of decideability as the halting problem. You can spend boundless time curating a list to flag/grawlix every possible string that would offend even the most prudish of prudes, and some would still get through. Such as the superficially benign "EATTHE"
https://www.dailymail.co.uk/news/article-2039662/Virginia-dr...