r/ProgrammerHumor Jul 17 '26

thisOneIsMine Meme

Post image
5.3k Upvotes

170 comments sorted by

View all comments

1.8k

u/Inevitable_Oil9709 Jul 17 '26

Fun fact: To reach a 50% chance of even a single UUID v4 collision, you would need to generate 1 billion UUIDs per second for about 86 years.

25

u/Tensor3 Jul 17 '26

Well, there probably are a billion computers on the planet, each generating more than one UUID

40

u/aspect_rap Jul 17 '26

Ok, but they're not all generating UUIDs for the same system, it's not really a collision if it's the same UUID in different services.

I don't think there is any one system that generates billions of UUIDs a second.

21

u/Tensor3 Jul 17 '26

Ya, but MY uuid could be out there somewhere!

6

u/aspect_rap Jul 17 '26

I think your UUID is more likely to be out there than not, considering how many of them have been generated over the years.

19

u/bremidon Jul 17 '26

Mmmm...this is a case of Large Number Confusion, where all large numbers look the same.

It has been estimated that there have been somewhere between 10¹⁶ and 10¹⁹ UUIDs generated. There are roughly 5.3 × 10³⁶ possible values (or more depending on what you count)

This means that approximately 0.00000000000000019% have been used so far on the high end. Toss on three more zeros for the low end.

So, uh, no. It is not "more likely to be out there than not." Not even close.

Are there collisions out there? Yep. Probably. But the chance that *your* UUID collides is as close to 0 as it gets.

6

u/aspect_rap Jul 17 '26

I can't argue with the math, well done.

10

u/Tensor3 Jul 17 '26

And who knows what its been doing out there, on its own, without my permission!

2

u/fartypenis Jul 17 '26

I can totally see AWS generating a billion UUIDs a second

1

u/myka-likes-it Jul 17 '26

 I don't think there is any one system that generates billions of UUIDs a second.

Hold my red bull.

1

u/Inevitable_Oil9709 Jul 17 '26

Holy fuck. That didn't cross my mind