logoalt Hacker News

erikeriksonyesterday at 7:35 PM1 replyview on HN

Super simple to detect and try again.


Replies

jandrewrogersyesterday at 7:58 PM

A collision is simple to detect but it requires you to actually check, which is expensive at scale. The entire point of UUIDv4 is that you don't have to check for collisions because it should never happen. But if you don't check and it does happen you are in UB territory which is generally very bad.

A risk of collision before it happens is non-trivial to detect but this is really what you'd want.

show 1 reply