Expand description
Cyclic redundancy checks.
A CRC of degree $L$ appends the remainder of $D^{L} a(D)$ divided by the generator polynomial $g(D)$ to the information bits $a(D)$ (most significant bit first, zero initial state, no reflection, no final XOR — the convention of 3GPP TS 38.212, Sec. 5.1). The polynomials of 5G NR are provided.
| Constructor | $g(D)$ | Use in NR |
|---|---|---|
Crc::crc24a | 0x864CFB | transport blocks |
Crc::crc24b | 0x800063 | code blocks |
Crc::crc24c | 0xB2B117 | downlink control (polar) |
Crc::crc16 | 0x1021 | small transport blocks |
Crc::crc11 | 0x621 | uplink control (polar) |
Crc::crc6 | 0x21 | uplink control (polar) |
§Examples
use comnum_fec::crc::Crc;
let crc = Crc::crc24a();
let mut word = crc.attach(&[1, 0, 1, 1, 0, 0, 1]);
assert_eq!(word.len(), 7 + 24);
assert!(crc.check(&word));
word[3] ^= 1;
assert!(!crc.check(&word));§References
- 3GPP TS 38.212, NR; Multiplexing and channel coding, Sec. 5.1.
- W. W. Peterson and D. T. Brown, “Cyclic codes for error detection,” Proc. IRE, 49(1), 228–235, 1961.