GUID is used as a unique identifier, it is also called the UUID - Universally Unique Identifier.To identify objects of the same type, unique names or numbers are usually used. However, when developers around the world independently create objects and assign identifiers to them, then this method can no longer guarantee uniqueness and here comes the use of GUID or UUID
0958d72c-9ecc-43bc-9531-33d6422c460c
GUID (Globally Unique Identifier) ​​- a static unique 128-bit identifier. Its main feature is the uniqueness, which allows you to create extensible services and applications without the fear of conflicts caused by the coincidence of identifiers. Although the uniqueness of each individual GUID is not guaranteed, the total number of unique keys is so high (2128 or 3.4028 × 1038) that the probability that two matching keys are independently generated in the world is extremely small.
A GUID consists of four parts separated by a dash character and containing a total of 32 characters, which are a hexadecimal representation of 16 bytes (128 bits). Those. two characters in a GUID (octet) are one byte in hexadecimal. GUID Example: b0d4ce5d-2757-4699-948c-cfa72ba94f86
UUID is a term from the rfc4122 standard that the worldwide standardization organization eitf will publish.
Roughly speaking, the GUID is what happened in practice with Microsoft. The theory differs with practice in the same way as XML with HTML.
It is determined by the type:
- Random: Just use the random number generator to create a 128-bit number.
- Time-based: Create a GUID based on the current time.
- Hardware-based: Make a GUID with certain portions based on hardware features, such as the MAC address of a network card.
- Content-based (MD5 or SHA-1 hash of data): Create a GUID based on hash of the file contents. Files with the same contents will get the same GUID