UUID is a 128-bit globally unique identifier, usually represented by a 32-byte string. It can ensure the uniqueness of time and space, also known as guid, all called: UUID -- universally unique identifier in Python UUID guid -- globally unique identifier C # is called guid. It guarantees the uniqueness of the generated ID through MAC address, timestamp, namespace, random number, and pseudo-random number.. There are five UUID types Algorithm , That is, five methods to achieve this: 1. uid1 () -- generates MAC addresses, current timestamps, and random numbers based on timestamps. Global uniqueness can be guaranteed. However, Mac security issues are also caused by the use of Mac. IP addresses can be used in LAN to replace MAC. 2. uuid2 ()-based on the distributed computing environment DCE (this function is not available in Python), the algorithm is the same as uid1. The difference is to replace the first four positions of the timestamp with the POSIX uid. This method is rarely used in practice. 3. uuid3 () -- name-based MD5 hash value is obtained by calculating the name and namespace MD5 hash value, ensuring the uniqueness of different names in the same namespace, and the uniqueness of different namespaces, but the same name of the same namespace generates the same UUID. 4. uuid4 ()-a random number is obtained from a pseudo-random number with a certain repetition probability. This probability can be calculated. 5. uuid5 () -- the name-based SHA-1 hash value algorithm is the same as that of uuid3. The difference is that the secure hash algorithm 1 algorithm is used. First, Python does not have a DCE-based algorithm, therefore, uuid2 can be ignored. Second, uuid4 is probabilistic and repetitive. It is recommended that uuid1 be used in a global distributed computing environment, uuid3 or uuid5.