我有一个看起来像的十六进制数组:
31 31 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
将其转换为二进制时,如下所示:0011000100110001
每个位都是与数组中的数字相关的标志。在这种情况下,这个二进制数将等于 2,3,7,10,11,15。
我不确定这种表示法是否有名称,但是否有任何简单的方法可以将十六进制转换为十进制数字列表,如上所示。
所以,
每个0x31
相当于一个字节或 8 位。
每个0x31
转换为00110001
.
然后应该解释这个二进制文件的方式是。
0 1 2 3 4 5 6 7 8 9 10
0 0 1 1 0 0 0 1 ......
在这里你可以看到我从0x31
.
希望这是有道理的。任何帮助将不胜感激。