为什么我们需要反转crc?在什么情况下我们需要这样做? [英] Why we need to invert crc? In which cases we need to do this?

查看:180
本文介绍了为什么我们需要反转crc?在什么情况下我们需要这样做?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么我们需要反转crc?在什么情况下我们需要这样做?(求均值 crc =〜crc )

它是针对零情况的防御吗(当整个消息由零组成时)?

在这种情况下如何提供帮助?

解决方案

您的意思是反转,或者取一个人的补语.(反向表示交换位的顺序,取消CRC计算或对CRC参数进行反向工程.)

以这种方式定义CRC参数时,便可以完成此操作.请参见此CRC列表,其中带有 xorout 的CRC.定义为全1在返回之前将CRC求反.

一个常见的例子是,当初始寄存器的内容 init 也是全1时,因此最后的 xorout 然后将空字符串的CRC设为零. init 为非零值是针对全零"消息情况捍卫"的方式,这确保了每个零都会更改CRC.然后, xorout 仅提供空消息为零的CRC校验字.那里有CRC定义,其中 xorout 为零(没有取反或异或末尾),但非零的 init 也提供了这种防御.

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?

解决方案

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.

这篇关于为什么我们需要反转crc?在什么情况下我们需要这样做?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆