英文:
Normal polynomial (0x04C11DB7) code to generate the reverse CRC output (0xEDB88320)
问题
E.g., 对于数据='1'的反向CRC32 = 0x83dcefb7
但我想使用标准/正向CRC-32代码,多项式为0x04C11DB7。为了得到与反向多项式相同的CRC,我需要额外遵循哪些步骤?
我尝试过将输入和最终CRC数据进行位翻转,但结果并不相同。
我还将0x83dcefb7进行位翻转得到0xedf73bc1。但我在正向CRC表中没有看到这个条目。
英文:
E.g., the reverse CRC32 for data ='1' = 0x83dcefb7
But I want to use the normal/forward CRC-32 code with polynomial 0x04C11DB7. What step do I need to follow additionally in order to get the same CRC as the reverse polynomial (i.e: 0x83dcefb7)
I tried with bit reversing the input and the final CRC data. But this is not giving the same result.
I also bit reversed 0x83dcefb7 is 0xedf73bc1. But I don't see this entry in the normal/forward CRC table.
答案1
得分: 2
I see four in Greg Cook's catalogue, and you could define many more. So I have no idea what you're starting with.
There is more than one such reflected CRC as well, but I can tell from your CRC of the string "1"
that what you want to replicate is the CRC-32/ISO-HDLC.
If you happen to be starting with the forward CRC-32/BZIP2, which has the same initial and final values as CRC-32/ISO-HDLC, then what you would need to do is reflect the input bytes, e.g. "1"
becomes "\x8c"
, and then reflect the resulting CRC.
英文:
There is not just one "normal/forward CRC-32 code with polynomial 0x04C11DB7". I see four in Greg Cook's catalogue, and you could define many more. So I have no idea what you're starting with.
There is more than one such reflected CRC as well, but I can tell from your CRC of the string "1"
that what you want to replicate is the CRC-32/ISO-HDLC.
If you happen to be starting with the forward CRC-32/BZIP2, which has the same initial and final values as CRC-32/ISO-HDLC, then what you would need to do is reflect the input bytes, e.g. "1"
becomes "\x8c"
, and then reflect the resulting CRC.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论