Another, less known, useful thing about these IDs is that you can double click on them and the full id will always be selected
Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
21–30 of 236 posts
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#22Earlier 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.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#23Example:
|-A-|-|------------B--------------|
NMSPC-9TWN1-HR7SV-MTX00-0H8VP-YCCJZ
A = Namespace, padded to 5 chars. Max 5 chars. Uppercase.
B = Blake3 hashed microtime with a random key.
I like how it folds in a time component but that it also doesn't reveal the time it was generated.Here's the snippet: https://gist.github.com/jszym/d3c7907b7b6e916f68205c99e5e489...
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#24Unrelated, 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?
The Scunthorpe problem? https://en.m.wikipedia.org/wiki/Scunthorpe_problem
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#25Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#26Earlier 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.
[1] https://newsfeed.time.com/2013/12/17/delta-airlines-is-very-...
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#27Unrelated, 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?
In the end I think we had a couple of characters to spare, and so, sitting by ourselves because everyone else had gone home for the day, we ranked swear words by how offensive they were to prioritize removal of a few extra letters. Then I convinced him that slurs were a bigger problem so we focused on that, which got rid of the letter n, instead of u
tggr is just cute, n**r is an uncomfortable conversation with multiple HR teams (we were B2B)
I'm a bit fuzzy now on what our ultimate character set was, because typically you're talking [a-z][0-9], an there are a lot of symbols you can't use in urls and some that are difficult to dictate. My recollection is that we eliminated both 0, l, and 1, but I think we relied on transcription happening either from all caps or all lowercase. 0o are not a problem. Nor are 1L.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#28Another, less known, useful thing about these IDs is that you can double click on them and the full id will always be selected
This is a setting in your terminal emulator. For me, plain UUIDs are selected just fine when double clicking.
Re: Type-safe, K-sortable, globally unique identifier inspired by Stripe IDs
#29UUIDv7 has been taking HN by storm for years now! When is it going to become a proper standard, and when are libraries and databases and all the rest going to natively support it?