this post was submitted on 24 Nov 2025
357 points (99.2% liked)
Programmer Humor
27490 readers
1557 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
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)