Finding the correct formula for a coded hexadecimal value in decimal value

I have a case where I am trying to understand how a hexadecimal number is converted to a decimal number.

I had a similar case before, but it turned out that if I canceled the hexadecimal string and changed every second value (little-endian), and then converted it back to decimal, I got what I wanted, but this one is different.

here are the values ​​we got

Value nr. 1 - Dec: 1348916578 Hex: 0a66ab46

I only have one decimal / hexadecimal, but I'm trying to get more values ​​to compare the results.

I hope that any mathematical genius there can see which formula could be used here :)

thank

+3
source share
4 answers
1348916578
= 5    0    6    6     D    5    6    2 hex
= 0101 0000 0110 0110  1101 0101 0110 0010

0a66ab46
= 0    A    6    6     A    B    4    6 hex
= 0000 1010 0110 0110  1010 1011 0100 0110

So, if the number looks like this, in hexadecimal digits:

AB CD EF GH

Then a possible conversion:

rev(B) rev(A) rev(D) rev(C) rev(F) rev(E) rev(H) rev(G)

where revreorders bits in a piece; although I can see that the U-turn can also be done on a byte-wise basis.

+11
source

Interesting .... I expanded the decimal and sixth in binary format, and this is what you get, respectively:

1010000011001101101010101100010
1010011001101010101101000110

Slide the bottom with a pad with some 0, then split into 8-byte blocks.

10100000 1100110 11010101 01100010
10100    1100110 10101011 01000110

He seems to be starting to line up. Let the bottom look like the top.

Place the first block with 0 and equal. The second block is fine. Switch the 3rd block (turn it over) and 10101011 will become 11010101.

10100000 1100110 11010101 01000110

Similarly with the 4th.
  10100000 1100110 11010101 01100010

Now they are the same.

10100000 1100110 11010101 01100010
10100000 1100110 11010101 01100010

? .

+4

x0a66ab46 174500678 1185637898 ( , , 8, 16 32- ). , . , ? , , .

, Delphi : SysUtils.IntToHex

0

, -USB-, , . . , 9 .

But this does not work the other way around (unless we separate 2 characters from the hexadecimal value, the decimal decimal code will only show part of the complete binary code).

So, the case is closed.

0
source

Source: https://habr.com/ru/post/1796283/


All Articles