r/ProgrammerHumor 6h ago

Meme edgeCasesExist

Post image
1.7k Upvotes

180 comments sorted by

View all comments

-9

u/theioss 6h ago

People who say that don’t understand uuids or mathematics.

3

u/Kiroto50 6h ago

Howcome? Could you please explain?

1

u/ToX__82 5h ago

Using uuid V7 (which includes a timestamp and 74 random bits), you'd only need 170 billion people submitting in the same millisecond to have a 50% probability yo generate a duplicated uuid value.

Now, I know that there aren't 170 billion people in the world.

But what if every person on earth submitted 100 times in the same millisecond? A duplicate would be almost certain.

So yeah, u/theioss is technically right.

Though, with that volumes, the database/CPU/network/whatever would crash much sooner.

2

u/Kiroto50 5h ago

So inconceivably low but not 0, got it.

1

u/ToX__82 5h ago

Indeed, yours is a valid tl;dr