为什么十六进制的 44100 在十六进制编辑器中的顺序相反?
我通过十六进制编辑器打开了一个波形文件。我尝试了两个十六进制编辑器,都以相反的顺序将 44100 转换为十六进制(AC44)。
这是为什么?对于 ASCII 字符“fmt”,排序是自然的。
这是 AC44。
这与 Big-Endian / Little-Endian 有关吗?但为什么其他值会以正确的顺序显示呢?
谢谢!
I opened a wave file through hex editor. I tried two hex editors, and both put 44100 in hex (AC44) in reversed order.
Why is that? For ASCII characters, "fmt", the ordering is natural.
This is AC44.
Does this have to do with Big-Endian / Little-Endian? But why would other values displayed in the correct order?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,它以小端格式存储。每个字段的字节顺序显示在此处:
请注意,存在大端和小端的混合。
Yes, it is stored in little endian format. The endianness of each field is shown here:
Note that there is a mixture of big and little endian.
它确实与字节序有关。您要写入的数据类型是整数,它存储为多字节块。
文本原子看起来没有反转的原因是因为它们是单字节字符的有序列表。
It does have to do with endian-ness. The data type you're writing to is an integer which gets stored as a multiple byte chunk.
The reason the text atoms look like they aren't reversed is because they are an ordered list of single byte characters.
实际上,这取决于体系结构和/或文件格式,请参见此处。您可以找到两种情况,一种是高字节在先,另一种是低字节在先。在您的情况下,它是第一个(称为小端)。
Actually it depends on the architecture and/or file format, see e.g. here. You can find both cases, one where the high byte comes first and also where the low byte comes first. In your case it is the first (called litte endian).
因为您的十六进制编辑器从低地址到高地址打印十六进制字节,而小端(例如 x86/ia32)机器将多字节实体的低位存储在低地址中。
如果您想以相反的顺序查看字节,您可以从高地址到低地址(但仍然从左到右)打印内存,因为在英语国家通常以这种方式打印数字。
Because your hex editor is printing out hex bytes from low address to high address, and little-endian (such x86/ia32) machines store the low digits of multi-byte entities in the lower address.
You could print out memory from the high addresses to the low addresses (but still left to right) if you want to see bytes in the opposite order, since numbers are usually printed out that way in English speaking countries.