binarybittwos-complementuint32

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:

TID: 0xe0380000 = 14560

As i know converting 0xe0380000 to decimal will be 3761766400, not 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. What is the reason for such a method to convert? Is it any thing to do with Uint32 part in the documentation table?


Solution

  • In the documentation table from the link that you've provided, the type for TID is Uint32-LittleEndian and the size is 4 bytes. Endianness indicates the order of bytes: