正规多项式(0x04C11DB7)生成反向CRC输出的代码(0xEDB88320)。

huangapple go评论55阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2023年5月15日 12:11:05
  • 转载请务必保留本文链接:https://go.coder-hub.com/76250834.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定