CRC是否具有以下特点
当数据传输被篡改1位或2位时,接收方能否自动纠正?
When the data transmission is tampered 1 bit or 2 bits, can the receiver correct it automatically?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不,CRC 是检错码,而不是纠错码。
点击此处了解更多信息
No, CRC is an error-detecting code, not an error-correcting code.
Read more here
CRC 主要用作错误检测码。但是,如果总位数(包括 CRC 中的位数)小于 CRC 的周期,则可以通过计算校正子(对计算出的和接收到的 CRC 进行异或)来纠正单位错误。如果单独翻转,每个位都会产生独特的综合症。人们可以迭代 CRC 算法来找到与每一位相关的综合症;如果发现与每一位相关的综合症,就可以翻转它并纠正一位错误。
然而,这样做的一个主要危险是,CRC 在拒绝虚假数据方面的用处要小得多。如果对包含 15 字节数据的数据包使用 8 位 CRC,则 256 个随机数据包中只有一个能够通过有效性,但所有随机数据包的一半可以通过翻转一位来“纠正”。
CRC is primarily used as an error-detecting code. If the total number of bits (including those in the CRC) is smaller than the CRC's period, though, it is possible to correct single-bit errors by computing the syndrome (xor the calculated and received CRC's). Each bit will, if flipped individually, generate a unique syndrome. One can iterate the CRC algorithm to find the syndrome that would be associated with each bit; if one finds the syndrome associated with each bit, one can flip it and correct a single-bit error.
One major danger with doing this, though, is that the CRC will be much less useful for rejecting bogus data. If one uses an 8-bit CRC on a packet with 15 bytes of data, only one in 256 random packets would pass validity, but half of all random packets could be "corrected" by flipping a single bit.