Why we need to invert crc? In which cases we need to do this?

家住魔仙堡 提交于 2021-01-29 04:18:13

问题


Why we need to invert crc? In which cases we need to do this? (invert mean crc = ~crc)

Is it defence from zero cases (when whole message is consists of zeros)?

How it helps in this case?


回答1:


You mean invert, or take the one's complement. (Reverse would mean swapping the order of the bits, undoing a CRC calculation, or reverse-engineering the CRC parameters.)

That is done when the CRC parameters are defined that way. See this list of CRCs, where those with xorout defined as all 1's are inverting the CRC before return.

A common example is when the initial register contents, init is also all 1's, so the final xorout then makes the CRC of an empty string zero. The init being non-zero is how you "defend" against the all-zeros message case, which assures that every zero changes the CRC. The xorout then just provides the nicety of a CRC of an empty message being zero. There are CRC definitions there with zero xorout (no invert or exclusive-or at the end), but a non-zero init, which provides that defense as well.



来源:https://stackoverflow.com/questions/39385468/why-we-need-to-invert-crc-in-which-cases-we-need-to-do-this

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!