The probability of this kind of UUID duplication can be calculated, but random things are like buying lottery tickets: it is impossible for you to expect it to get rich, but shit luck usually comes inadvertently. Generate a UUID based on a random number, or a pseudo-random number. This version of UUID guarantees: the uniqueness of UUIDs generated by different names in the same namespace the uniqueness of UUIDs in different namespaces the repeated generation of UUIDs with the same name in the same namespace is the same. Name-based UUIDs are obtained by computing the MD5 hash of the name and the namespace. However, due to the order of time factors, the low order is first and the high order is last, so it is not suitable for primary keys and can be combined. If the application is only used in a local area network, a degenerate algorithm can also be used to replace the MAC address with the IP address-Java's UUID is often implemented in this way (of course, the difficulty of obtaining the MAC is also considered). But at the same time, using the MAC address brings security concerns, which is where this version of UUID has been criticized. Due to the use of MAC addresses in the algorithm, this version of UUID is guaranteed to be globally unique. The term GUID is also sometimes used specifically to refer to Microsoft's implementation of the UUID standard.Ī time-based UUID is obtained by computing the current timestamp, nonce, and machine MAC address. The total number of GUIDs reaches 2^128 (3.4×10^38), so the possibility of randomly generating two identical GUIDs is very small, but not zero. Ideally, no computer or cluster of computers would generate two identical GUIDs. The format of the GUID is "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", where x is a 32-digit hexadecimal number in the range 0-9 or af. Globally Unique Identifier (GUID, Globally Unique Identifier) is also called UUID (Universally Unique IDentifier).Ī GUID is an algorithmically generated numeric identifier with a binary length of 128 bits.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |