![]() ![]() The remaining 20 bits consist of 5 to 7 bits which are the variant (uses 4 bits) and the version (uses 1 to 3 bits) of the UUID and the remaining 13 to 14 bits are the clock sequence. The UUID is generated by concatenating the 48 bit MAC address and the 60 bit timestamp, which sums up to 108 bits. ![]() Version 1: These UUIDs are generated using the timestamp and the MAC address of the host machine.There are 5 versions defined for Variant 1 and Variant 2: The version of a UUID indicates how that UUID was generated. Microsoft sometimes uses a format in which it’s GUIDs are surrounded by curly braces. Variant 3 (N’s value ranges from e to f) Reserved for future definitions.These are reserved for Microsoft Corporation backward compatibility. Variant 2 (N’s value ranges from c to d) These variants are encoded in a mixed-endian format, it is mix of the big-endian and little-endian.Variant 1 (N’s value ranges from 8 to b) The general format is based on this variant and these variants are encoded in the big-endian format.These are reserved for (Network Computing Systems) NCS backward compatibility. Variant 0 (N’s value ranges from 0 to 7) In this variant the first 6 octets of the UUID are a 48-bit timestamp the next 2 octets are reserved, the next octet is the address family and the final 7 octets are a 56-bit host ID in the form specified by the address family.The variant of UUID indicates it’s format and encoding or simply the layout of the UUID, the variant tells us how all the other bits of the UUID are going to be interpreted. clock_seq_hi_and_res clock_seq_low -> the high field of the clock sequence multiplexed with the variant.time_hi_and_version -> the high field of the timestamp multiplexed with the version number.time_mid -> the mid field of the time stamp.time_low -> the low field of the time stamp.UUID = time-low “-” time-mid “-” time-high-and-version “-” clock-seq-and reserved clock-seq-low “-” node | clock_seq_hi_and_res clock_seq_low | 4 | The format which we have been seeing till now is based on the UUID record layout which is as follows. The hexadecimal character M represents the version of the UUID and the first 1 to 3 most significant bits, in the binary form, of the character N represent the variant of the UUID. Below is the general format or the canonical textual representation of a UUID. The variant of the UUID is represented in the UUID itself by one of the hexadecimal characters and the same goes for the version of the UUID. UUIDs are divided into different groups according to their Variant and Versions. The general format of a UUID is that it’s 16 bytes are represented as 32 hexadecimal(Base 16) values divided in five groups of length 8, 4, 4, 4 and 12 (total 32 characters) respectively, separated by hyphens “-”, which makes a single UUID 36 characters long, 32 hexadecimal characters + 4 hyphens. UUIDs are now 128 bits in size, double of what they originally used to be. How have UUIDs changed?īut, now the times have changed, UUIDs have evolved and grown bigger. In those time UUIDs used to be 64 bits long. Now for a bit of a history of UUID, the first use of UUID can be traced back to the 1980s when Apollo computers used them in their computing systems and was latter used by other organizations for the same. UUID stands for Universally Unique Identifier but Microsoft tends to call them GUID which stands for Globally Unique Identifier, well this is not the first time that Microsoft has changed the name of something to call it, it’s own or in order that someone not calls it theirs, if you are curious then go find out why Secure Socket Layer (SSL) became Transport Layer Security (TLS). If you want to know the in’s and out’s of UUIDs, then carry on and you can be sure that it will be quite interesting to know that how do computers generate such big random strings(because computers are very bad at generating random numbers) with the smallest possibilities of collision between any 2 UUIDs created by any computer in the world. Well, it might not be important to us but it does play a very important role, which is to uniquely identify each and every record or tuple or document or whatever you call it among millions and millions of records. Obviously, how can something like 123e4567-e89b-12d3-a456-426614174000 ever be relevant to someone or something? So, if it’s not important then why should we care? These words might have not caught your attention as much as compared to other fields or attributes because of the values that these fields contain and also because these attributes are hard to read do not contain any relevant information to the object. If you have ever worked with any kind of database, be it SQL or NoSQL, in your life, then you must have come across words like _id, ID, _id or ObjectId.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |