Hacker News new | ask | show | jobs
by dickfickling 713 days ago
I have long considered building a code generator that only serves "nice" codes.

The standard implementation would use a hard coded set of patterns. The enhanced version would pair automatic random code generation with a public site where members of the public can decide in real time whether a given code is "nice" before it's sent along to the intended recipient.

(note @tptacek if you're reading this, I swear it's (mostly) a joke)

2 comments

Hmm for 2 digits you only have one "nice" code (69). For three digits it's the same (069). For four digits you do get two (0069 and 6969), but I think you need a lot of digits before "nice" codes are effective.
I've always been under the impression that popular TOTP implementations were specifically designed to produce "nice" codes. They always have repeated digits, like 202838.
I think that's just the birthday paradox. It's highly likely for a randomly generated number to have some repeated digits.