5 ms·
When it comes to censoring randomly generated strings, I like simply to omit vowels from the alphabet. Usually I'll omit some of the more obvious lookalikes too
by ademarre 5y ago
When it comes to censoring randomly generated strings, I like simply to omit vowels from the alphabet. Usually I'll omit some of the more obvious lookalikes too, e.g. [1 0 v].
It's a simple solution. Sure, it is still possible for something to slip through that looks similar to something bad. But the potential to strongly offend is greatly reduced.
- cratermoon 5y agoYeah 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.
- xdfgh1112 5y agoGov.uk did this. The code WNKR still ended up on Reddit yesterday.
- ademarre 5y agoThat's amusing, but I think it also highlights the effectiveness of the strategy. WNKR is excusable and defensible. WANK would not be. Edit: But I'll concede that when your outputs are only four characters long and end users will actively interact with them (write them down, type them again later, etc.), additional safeguards might be appropriate. Or simply omit all alphas and use only numerics.
- tsimionescu 5y ago> Or simply omit all alphas and use only numerics. You're still not out of the park with numerics - people with 1313 or 6660 or 4444 or something will complain a lot. The possibility of a 666 in some new biometric government IDs in my country rose a massive stink from church...
- lelandfe 5y agoI was in the UK recently and - if you can believe it - there was a car on the block I stayed whose plates contained 666. Also, have a feelin you meant to do 1312. What’s the issue with 4444, though?
- DocTomoe 5y agoIn Germany, where you can request number plate combinations (as long as they are free and follow a few roles), 666 is a pretty common combination amongst young drivers. > What’s the issue with 4444 4 is pronounced similar to "death" in sino-japanese languages and dialects.
- exar0815 5y agoAlso, as you have the muncipality-shortcut at the beginning, and then two user-definable letters, you freqently see "rude" combinations, and noone bats an eye. BIT-CH, MON-GO, ANA-L, DIL-DO. (And those are just the combinations that are understandable in english which I saw when driving). I'll never forget the face of the guy at the Zulassungsstelle when I was there with a friend who wanted COC-K-6969. He got it it, btw. When I tried some years later, AC-DC-666 sadly was already taken.
- tapland 5y agoRemoving wovels would increase likelyhood of bad word combos, but removing consonants would have the desired effect.