CRC 校验位宽

#️⃣ CRC Checksum Width

Look up the checksum width and hex length for common CRC standards (CRC-8, CRC-16, CRC-32) for protocol design.

📐 计算公式与说明

CRC 校验位宽换算(按生成多项式次数 n):校验位宽 = n(bit)、十六进制长度 = ⌈n÷4⌉(字符)、余数空间 = 2ⁿ(个校验值)。校验:无强校验,空值按 0 兜底。判据:无固定分级,本页为位宽换算说明而非逐位 CRC 余数计算,输入字节数为参考项、不参与输出。

常见 CRC-8/CRC-16/CRC-32。

📚 深度解析:CRC 校验位宽

💡 常见使用场景

示例:CRC-32
位宽 32 bit,十六进制表示为 8 字符;CRC-16 为 16 bit、4 字符。

❓ 常见问题(FAQ)

位宽与标准名如何对应?
CRC-N 通常即 N 位校验值,具体多项式由标准规定(如 CRC-32 的 0x04C11DB7)。
为何需要多项式?
多项式决定检错特性,仅看位宽不够,跨系统须同一多项式。
表示长度怎么算?
每 4 bit 一十六进制字符,故 8/16/32 位对应 2/4/8 字符。

Formula & Standard References

Item Formula / Rule Source / Standard
CRC width Width r is the generator degree, bounding random-error escape probability at 2−r ISO/IEC 3309 HDLC frame check sequence
Computation Shift the message left by r bits, divide modulo 2 by the generator, and keep the remainder ITU-T X.25 §2.2.7.4 Frame Check Sequence
Common polynomials CRC-32 = 0x04C11DB7 with r = 32; CRC-16-CCITT = 0x1021 with r = 16 Koopman & Chakravarty, Cyclic Redundancy Code Polynomial Selection, 2004