开发者

Why are binary Guids different from usual representation

开发者 https://www.devze.com 2023-02-10 19:09 出处:网络
I ha开发者_如何学JAVAve the following Guid: AAB13E97-449B-4D5B-BDE2-AC479C31B782 Using System.Guid + DbLinq + SQLite to store it the following field is added to the database.

I ha开发者_如何学JAVAve the following Guid:

AAB13E97-449B-4D5B-BDE2-AC479C31B782

Using System.Guid + DbLinq + SQLite to store it the following field is added to the database.

973EB1AA-9B44-5B4D-BDE2-AC479C31B782

(Dashes added for clarity)

I can see that the last 8 bytes are in the same order, and the 3 first groups are reversed, but I don't understand why.


Looking at Wikipedia's article on the subject it says:

Data4 stores the bytes in the same order as displayed in the GUID text encoding (see below), but the other three fields are reversed on little-endian systems (for example Intel CPUs).

So I conclude:

  • This happens independently from the DBMS or framework used
  • This depends on the processor architeture
  • This is by design

So the question remains:

Why on earth they designed it this way?

0

精彩评论

暂无评论...
验证码 换一张
取 消