Is CRC32 additive?

前端 未结 4 977
遥遥无期
遥遥无期 2021-01-04 12:41

On several places I\'ve read that crc32 is additive and so: CRC(A xor B) = CRC(A) xor CRC(B).

The above statement was disproven by the following code I wrote:

<
4条回答
  •  粉色の甜心
    2021-01-04 13:12

    This would imply that each bit position of the CRC result is only driven by the equivalent bit position in the input. Consider your example with B == 0.

    The relationship you're describing is more likely to be true for some primitive xor or additive checksum algorithms.

提交回复
热议问题