Hacker News new | ask | show | jobs
by Goopplesoft 4248 days ago
Actually it can. As long as they aren't randomly generated. UUID4s are random, lots of them including the mongodb use a timestamp/mac address as the first n bits of the guid. Not sure whether they have "no chance of collisions" but it is very possible.
3 comments

"no chance" means making a claim that there will never be 2^N devices generating IDs simultaneously (for N somewhere around 30-60)

2 machines can have the same MAC addresses (they are reprogrammable) and can operate at the same microsecond.

"aren't randomly generated" is not practical constraint in a high-speed distributed system (where you don't have time for synchronization overhead).

Its an infinitesimally small chance. You'd need a mac collision, must be generated at the same time, and a uuid collision. Even at the largest scales (Google et all) the probability of that happening is effectively 0.
Yes. And my glass of water could spontaneously turn into ice. However, I do not expect it to happen anytime soon.
Please, generate 2^<length>+1 of them and let me know how it goes.