Likelihood of collision using most significant bits of a UUID in Java
问题 If I\'m using Long uuid = UUID.randomUUID().getMostSignificantBits() how likely is it to get a collision. It cuts off the least significant bits, so there is a possibility that you run into a collision, right? 回答1: According to the documentation, the static method UUID.randomUUID() generates a type 4 UUID. This means that six bits are used for some type information and the remaining 122 bits are assigned randomly. The six non-random bits are distributed with four in the most significant half