this post was submitted on 24 Nov 2025
380 points (98.7% liked)

Programmer Humor

27500 readers
1724 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[โ€“] io@piefed.blahaj.zone 9 points 1 day ago (1 children)

i was curious how unlikely exactly this would be.

The randomUUID method generates a new version 4 UUID

which is, According to the linked documentation, a 128bit number, with some "significant bits" being changed (no idea what that's about, lets just say it's a 128bit number)

the chance of hitting a predfined number would be

1/(2^128) or 1/340282366920938463463374607431768211456

assuming your cpu does one comparison per Step at 4Ghz (4 billion per second) (idk how many steps it needs in reality, it doesn't matter, more then one tho)

that would take roughly

2.696 x 10^21 years, which is

2 x 10^11 or 200000000000 times the age of the universe

(using the expected value of geometric distribution (1/p), so 1/(1/(2^ 128)) = 2^128 steps)

[โ€“] JackFrostNCola@aussie.zone 4 points 18 hours ago

...so your saying theres a chance.