4 ms·
Depending on the font used, 'I' and 'L' can be easily confused by humans. 'O' can be read as '0' too. This is meant to prevent that. As for the 'U', I'm not su
by tsenart 10y ago
Depending on the font used, 'I' and 'L' can be easily confused by humans. 'O' can be read as '0' too. This is meant to prevent that.
As for the 'U', I'm not sure why the original ULID spec left it out. Thanks for raising this. I'll investigate.
- Guvante 10y agoWell you need to leave 4 characters out to get to 32, so unless there is a better character the selection is arbitrary.
- tyingq 10y agoTypically, 'U' is omitted to avoid accidentally putting the word FUCK into the generated output. No, not kidding. See http://www.crockford.com/wrmg/base32.html http://www.crockford.com/wrmg/base32.html, Ctrl-F, search for obscenity. Edit: Interestingly, since it already omits the letter I, adding U covers all of George Carlins' 7 Dirty Words: https://en.wikipedia.org/wiki/Seven_dirty_words https://en.wikipedia.org/wiki/Seven_dirty_words
- joshuak 10y agoThis is so bazar that I don't even know where to start to try an understand it. Is it a joke? Tongue-n-cheek? It must be. I can't understand how it could possibly be a ligament concern. What about other languages? As adults who doesn't use 'fuck' conversationally? If it were a real concern then surly drawing attention to it in the design of the ID is a more obvious then the very rare occasion of 'dirty words' (by some definition of dirty) appearing in otherwise random strings. So I have to conclude it's a joke, but then what the fuck? This type of thing puts noise into engineering details that just ends adding to confusion and ambiguity. If there's no (important) reason for 'U' to be in the omission set, then just say it's an arbitrary choice, if there is an OCR, or legibility reason then say that. Half of my brain says it's funny, and half my brain says it's fucked up.
- tyingq 10y agoI see where you're coming from. On the other hand, since they were after base32, they were able to choose an additional letter to omit. By omitting the U, they happen to exclude the most popular english language expletives. These things can and do end up in, for example, urls. Think something like an ecommerce store order id. While not likely to happen, the below could happen in an email, and might invite unneeded controversy: "Dear Mr Customer, Please Click Here to see your order status: http://example.com/status/FUCKUP6433432334234 http://example.com/status/FUCKUP6433432334234 "
- joshuak 10y agoAh yes ok I can understand that. I can see from a marketing point of view that you might want to simply and quietly avoid the (roughly) 1 in 1,000,000 ids which start with 4 specific characters. Still, it's a bit culturally specific. It gives the impression of solving a problem that is doesn't. Depending on your market/language a different character might be a better choice. Plus there are quite a few 'bad' words that can still appear. Filtering and rejecting proposed IDs based on a list of objectionable words seems like a far more realistic solution, then baking a very specific exclusion into the plumbing.
- emmelaich 10y agoOmitting U is great bang for your buck. When I wrote a simple password generator as well as omitting u or U I also omitted all of 1iIlL and oO0. Then I thought - the hell with it, I'll leave out all vowels to reduce the chance of offending someone. I had to increase the length to compensate. By how much I'll leave as an exercise for the reader.