3 ms·
> UUIDs ... endianess is not little, big - its mixed. mixed in the same value UUIDs do not have any endianness. They are just a sequence of individual bytes.
by quietbritishjim 5y ago
> UUIDs ... endianess is not little, big - its mixed. mixed in the same value
UUIDs do not have any endianness. They are just a sequence of individual bytes.
It's true that some ways of generating UUIDs work by using the bytes of longer numbers, which I can believe use mixed endianness (I don't know them well enough to remember myself). But no one should be relying on that when reading UUIDs back out, except maybe for debugging purposes.
Or does GPT require interpreting the parts of UUIDs? If so, that is the real problem.
- blueflow 5y agoIts relevant for converting them from and to their string representation. https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding https://en.wikipedia.org/wiki/Universally_unique_identifier#...
- quietbritishjim 5y agoInteresting link, thanks, I wasn't aware of that. The link seems to suggest that the odd mixed-endian string representation ("Variant 2") is now quite rare. With the one that's more common ("Variant 1"), I'd say that I *slightly* disagree that representing the byte sequence 99,aa,bb,cc as 99aabbcc is "big endian". If you don't philosphically think of the latter as a number, then it's just the bytes written out compactly. But I do see that if you think of it as a number then it's big endian, especially if you're distinguishing from variant 2.
- GoblinSlayer 5y agoVariant is a very abstract concept mostly for humans, programs pay no attention to it and serialize all kinds of UUID the same way.
- GoblinSlayer 5y agoUUID is defined as a sequence of 6 integer fields of various sizes. Their conversion to text is fairly straightforward, but serialization to bytes may vary depending on how you do it. "Whatever ends up in memory" is microsoft little endian format.