How UUID v4 Works: Random Bits and Collision Math
Ask how UUID v4 works and you'll usually hear that it's random. True, but the interesting part is how random, and what the format actually guarantees. A v4 identifier packs 122 random bits into 36 characters, enough that two machines can mint keys independently for centuries without producing a duplicate. This article breaks down the version and variant bits, walks through a real generated value, puts honest numbers on collision risk, and lists the mistakes that turn a perfectly good identifier scheme into a support ticket.