wire / wire-format / crc

CRC (Cyclic Redundancy Check)

CRC is an error-detecting code based on polynomial division. Data is treated as a polynomial; divided by a generator polynomial; remainder is the CRC. Common CRCs: CRC-8 (0x07), CRC-16-CCITT (0x1021), CRC-32 (0x04C11DB7, used in Ethernet, ZIP, PNG), CRC-64 (0x000000000000001B). Properties: detects all single-bit errors, all double-bit errors (for CRC width ≥ 2), all odd-bit errors (if generator has factor x+1), burst errors up to width bits.

wire-format kind wire-format status standard verification verified tier B wire-format@1

aka: CRC (Cyclic Redundancy Check)

wire format

spec: CRC (Peterson, 1961)

CRC is an error-detecting code based on polynomial division. Data is treated as a polynomial; divided by a generator polynomial; remainder is the CRC. Common CRCs: CRC-8 (0x07), CRC-16-CCITT (0x1021), CRC-32 (0x04C11DB7, used in Ethernet, ZIP, PNG), CRC-64 (0x000000000000001B). Properties: detects all single-bit errors, all double-bit errors (for CRC width ≥ 2), all odd-bit errors (if generator has factor x+1), burst errors up to width bits.

fieldsizemeaning
Generator polynomialdegree+1 bitsThe divisor polynomial. E.g., CRC-32: x^32 + x^26 + x^23 + x^22 + x^16 + x^12 + x^11 + x^10 + x^8 + x^7 + x^5 + x^4 + x^2 + x + 1 (0x04C11DB7).
CRC computationO(n) with lookup tableProcess data byte by byte. For each byte, XOR with CRC register, look up in table, shift. O(n) with table, O(n*w) without.
CRC-324 bytesPolynomial 0x04C11DB7. Used in Ethernet (FCS), ZIP, PNG, gzip, and many other formats.
CRC-16-CCITT2 bytesPolynomial 0x1021. Used in X.25, HDLC, and many telecom protocols.
CRC-81 bytePolynomial 0x07. Used in SMBus, I2C, and small packets.
Detection capabilitypropertiesDetects: all single-bit errors, all double-bit errors (width ≥ 2), all odd-bit errors (if gen has x+1 factor), burst errors ≤ width bits.

example:

00 00 00 00

CRC (placeholder)


provenance

agent: curl -H 'accept: application/json' wire.phall.io/wire-format/crc or /wire-format/crc.json