Show HN: The 2FA app that notifies you when you get `012345`
jacobbartlett.substack.com
jacobbartlett.substack.com
Which makes me wonder, what's the expected repeated distribution?
There's _much_ better approximations than the sqrt one, but I don't know them and the actual math is too hard.
Sextuples are 1 in 100,000, so something like every 50 days (per account).
Yeah I screwed up here, at the end:
> Sqrt of a million is a thousand, and if they're every 30 seconds, that's ~8 hours or so. So you probably get a duplicate or 2 every day.
You'd get 1 or 2 every day (approx.) if you're only, at any point, looking at the collection of codes generated in the past 8 hours. But of course that wasn't the question, and the odds go way up once the period we're looking at goes larger and larger over time.
I shouldn't have tried to go beyond "ballpark if you wait 8 hours you have a coinflip of having at least one duplicate", anything more than that requires different math.
For sextuplets, you can just check whether the value is zero modulo 111111...
I did the first sweep of optimisations to kill the super-slow regex and turn the slowest operations into a set matching operation.
I considered pre-processing all the potential interesting codes, reducing everything to a simple dict/set matching, but by that point the actual operation to generate OTPs was orders of magnitude slower than everything else, so there would be negligible user-facing benefit to doing so.
I feel like the fact that you need to pay $100/year to publish an app to the app store and keep it there kind of kills off fun apps that don't have some plan for monetization.
If you add a switch to control iCloud Keychain syncability and backupability this will unironically blow Google Authenticator out of the water in terms of functionality as well.