4 ms·
Yeah there was an article I read a while back about a company looking to prevent the use of 'naughty' words in randomly-generated strings used as event IDs. App
by cratermoon 5y ago
Yeah there was an article I read a while back about a company looking to prevent the use of 'naughty' words in randomly-generated strings used as event IDs. Apparently someone with some pull had seen a message with an offensive word. Some management committee spent a long time trying to figure out how to solve the problem including proposing keeping a list of bad words, and then worrying about what should be in it and who would maintain it. At some point an engineer got a chance to speak and said something like "just use base-31 and omit vowels". The story as I remember it didn't mention the use of v or l33t-speak, but they were randomly generated, not maliciously constructed, values.
Also note that if you're too naive about checking for 'naughty' words, you get https://en.wikipedia.org/wiki/Scunthorpe_problem https://en.wikipedia.org/wiki/Scunthorpe_problem
- executesorder66 5y ago> didn't mention the use of v or l33t-speak What is 'v' in this context? Edit: thanks for the answers. It makes sense now.
- k_ 5y agoI suppose it's about the use of 'v' instead of 'u' in the F word
- dasv 5y agoIt's visually equivalent to a u, so without vowels it's still possible to get "fvck", for example.
- BoxOfRain 5y agoThe Romans wovld approve of svch a scheme.
- cratermoon 5y agoHow would the Romans have pronounced 'approve', though?
- mellavora 5y agoimagine the phrase "see you later" was offensive, or perhaps its abbreviation "cu" the combo "cv" could then become problematic.
- corobo 5y agoHashids does this (avoid bad words) if anyone is curious to see an implementation > algorithm tries to avoid generating most common English curse words by never placing the following letters (and their uppercase equivalents) next to each other: > c, s, f, h, u, i, t https://hashids.org/#how-does-it-work https://hashids.org/#how-does-it-work E: ah it was already mentioned later on, hadn't got that deep into the comments yet!
- cratermoon 5y agoOh yes, there's plenty of ways to avoid curse words, but each one has a cost, and if the system needs to generate ids very quickly, any scheme that works too hard could be a bottleneck. The naive way of just randomly throwing together letters of the alphabet will eventually generate a forbidden word. Any steps taken to reduce the probability should understand the time/space tradeoffs.