I have 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?

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top