3 ms·
They repeat roughly every year. 1,000,000 periods of 30 seconds is just less than 350 days.
by fanf2 2y ago
They repeat roughly every year. 1,000,000 periods of 30 seconds is just less than 350 days.
- Rygian 2y agoThey do not repeat. The totp is calculated with the whole Unix timestamp, not a cyclical counter.
- edent 2y agoYes, but there are only 6 digits available. So a million different codes can be generated. A new code is generated every 30 seconds Rather pleasingly, 30,000,000 seconds is roughly 1 year. So, assuming a uniform distribution of codes, you would expect to see a repeat after a year.
- matthewdgreen 2y agoA code may be repeated, but they should not enter a cycle (which would be a real disaster.) You also need to keep in mind the birthday paradox. Repeated codes will happen with high probability after around sqrt(1,000,000) = 1000 code emissions. https://en.wikipedia.org/wiki/Birthday_problem https://en.wikipedia.org/wiki/Birthday_problem