在Edward Kmett关于CRC的文章中,它有以下推导:
CRC(ab) = -- definition of CRC
crc(INIT,ab) + FINAL = -- linearity
crc(INIT,a0^n + 0^m b) + FINAL = -- additive homomorphism
crc(INIT,a0^n) + crc(0,0^nb) + FINAL = -- zero blindness
crc(INIT,a0^n) + crc(0,b) + FINAL -- definition of crc
crc(crc(INIT,a),0^n) + crc(0,b) + FINAL -- additive homomorphism
crc(crc(INIT,0^m)+crc(0,a),0^n) + crc(0,b) + FINAL
Run Code Online (Sandbox Code Playgroud)
世界上有什么a0^n
和0^m b
?这些权力是这样的a * pow(0, n)
吗?如果是这样,不会0 ^ n = 0?或者XOR?还有别的吗?这个空间有意义吗?我不明白为什么,例如:
ab = a0^n + 0^m b
Run Code Online (Sandbox Code Playgroud)
为什么0^m b
成为0^nb
第三和第四行之间?
他正在使用比特字符串表示法.这里a和b分别是长度为m和n的位串.
ab = a concatenated with b
0^n = the bit string of length n consisting of all 0s
a0^n = a concatenated with 0^n
0^m b = 0^m concatenated with b
a0^n + 0^m b = sum of a0^n and 0^m b (same as the bitwise OR in this case)
= a concatenated with b
Run Code Online (Sandbox Code Playgroud)