Tom Ritchford
Dec 16, 2023

--

But this is not a useful statistic, because such a system does not guarantee to produce all 128-bit IDs before restarting.

The correct calculation is this. Because of the Birthday Problem, you will to tend get collisions when you have produced a number of IDs equivalent to the square root of the number of total IDs.

In this calculation, that's 2^64 IDs. At a billion an hour, that's enough IDs for about two million years - a long time, but far less than your calculation.

However, Shitter is using 64-bit IDs! They will repeat once you start getting 2^32 IDs, which is about 4 billion. At a billion IDs an hour, you'd have a collision every four hours!

Lucky for them, they don't use a random system at all.

--

--

No responses yet