Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

BTW, it never happened to me, I have been working for more than 7 years as a developer maintaining over 1M plus records, but the twist is that we used to generate UUID by timestamps, which is now automatically handled by uuidv7, where the first half is our timestamps and the second half random number, so collisions never happen. In your case, you must be shifted to UUIDv7 without making any change, or just generate using a timestamp

But yeah, collision is expected in random generation; a UUIDv4 is a 128-bit number. If you subtract the bits used to specify the version and variant, you are left with 122 bits of pure randomness.That means there are $2^{122}$ possible combinations, where each 100 combination has chances of collision by 50%



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: