简体   繁体   English

反向二进制读取

[英]Reverse binary reading

I have a document that shows a data in HEX, and split it into multi part (head, TransactionID, MessageType and ...) There is a problem in this document, and it is for example for TID they write something like this:我有一个以 HEX 显示数据的文档,并将其拆分为多个部分(head、TransactionID、MessageType 和 ...)此文档中存在问题,例如,对于 TID,他们编写了如下内容:

TID: 0xe0380000 = 14560

As i know converting 0xe0380000 to decimal will be 3761766400 , not 14560 .据我所知,将0xe0380000转换为十进制将是3761766400 ,而不是14560 I figured out that the way they read data is something like this:我发现他们读取数据的方式是这样的:

For a given number such as 0xe0380000 they rotate the number and it will be 0x0000038e0 now the 0x0000038e0 in decimal is 14560 .对于给定的数字,例如0xe0380000他们旋转数字,现在它将是0x0000038e0现在十进制的0x0000038e014560 What is the reason for such a method to convert?这种方法转换的原因是什么? Is it any thing to do with Uint32 part in the documentation table?与文档表中的Uint32部分有关吗?

In the documentation table from the link that you've provided, the type for TID is Uint32-LittleEndian and the size is 4 bytes .在您提供的链接的文档表中, TID的类型是Uint32-LittleEndian ,大小是4 bytes Endianness indicates the order of bytes: Endianness表示字节的顺序:

  • Little Endian (LE) : - 14560 (10) - > e0 38 00 00小尾数 (LE) : - 14560 (10) -> e0 38 00 00

  • Big Endian (BE) : 14560 (10) -> 00 00 38 e0大端 (BE) : 14560 (10) -> 00 00 38 e0

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM