.net - 为什么二进制 Guids 与通常的表示不同

标签 .net sqlite binary guid dblinq

我有以下 Guid:

AAB13E97-449B-4D5B-BDE2-AC479C31B782

使用 System.Guid + DbLinq + SQLite 存储它,将以下字段添加到数据库中。

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

(为清楚起见添加了破折号)

我可以看到最后8个字节顺序相同,前3组是相反的,但我不明白为什么。

最佳答案

查看Wikipedia's article on the subject它说:

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).

所以我得出结论:

  • 这独立于所使用的 DBMS 或框架而发生
  • 这取决于处理器架构
  • 这是设计使然

所以问题仍然存在:

他们到底为什么要这样设计?

关于.net - 为什么二进制 Guids 与通常的表示不同,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5003061/

相关文章:

java - 从输入流读取错误 - 无法解析符号

c# - .NET BinaryReader 不遵守编码

java - Java中的遗传算法分类器:基于规则的系统

c# - 为什么 Delta.Patch 不会将字节数组更新为空值?

c# - 在 GDI+ 中递归绘制矩形时出现 OutOfMemory 异常

android - 使用 activeAndroid 更新多列

python - Python 中使用 unpack 读取二进制文件与 IDL 方法的比较

c# - 使用 BasicHttpBinding 进行 WCF 自定义证书验证

c# - 内存映射文件 .NET

java - sqlite 插入重复条目