About UUID

1 UUID version

version 1

NIC mac address time +

Version 2

This version can be ignored

Version 3

Calculate md5 unique name space, such as url, itself is unique.

Version 4

Randomly generated

 

How to ensure that the world's only 2 UUID

version 1

mac address of the card is the world's only, unless cloning, while the clock is ticking, so self-generated UUID is unique.

version 3

Namespace is unique, and then calculate md5

verison 4

Randomly generated in a large space, the collision probability is very small.

 

3 UUID probability of collision

Small

3.1 themselves and their collision

3.2 Collision own and others'

 

4 java version of the UUID

java the UUID of randomUUID generated version of the UUID 4.

 

Guess you like

Origin www.cnblogs.com/hustdc/p/11479645.html