Standard test vector
CRC implementations are commonly verified with the ASCII input 123456789.
- Input format
- ASCII
- Input
- 123456789
- Expected CRC
- 0xA066
Result is calculated from the current input. Check is the published verification value for the standard input 123456789. Click another algorithm to view its detail page.
Result
0x6F91
Check
0x6F91
Result
0x4B37
Check
0x4B37
Result
0xA066
Check
0xA066
Result
0x63D0
Check
0x63D0
Result
0x26B1
Check
0x26B1
/*
* Model: CRC-16 / NRSC-5 (16-bit)
* Poly: 0x080B, Init: 0xFFFF, XorOut: 0x0000
* CRC Table C Source Code & Lookup Table Generator
*/
#include <stdint.h>
#include <stddef.h>
const uint16_t crc_table[256] = {
0x0000, 0x35A4, 0x6B48, 0x5EEC, 0xD690, 0xE334, 0xBDD8, 0x887C,
0x0D01, 0x38A5, 0x6649, 0x53ED, 0xDB91, 0xEE35, 0xB0D9, 0x857D,
0x1A02, 0x2FA6, 0x714A, 0x44EE, 0xCC92, 0xF936, 0xA7DA, 0x927E,
0x1703, 0x22A7, 0x7C4B, 0x49EF, 0xC193, 0xF437, 0xAADB, 0x9F7F,
0x3404, 0x01A0, 0x5F4C, 0x6AE8, 0xE294, 0xD730, 0x89DC, 0xBC78,
0x3905, 0x0CA1, 0x524D, 0x67E9, 0xEF95, 0xDA31, 0x84DD, 0xB179,
0x2E06, 0x1BA2, 0x454E, 0x70EA, 0xF896, 0xCD32, 0x93DE, 0xA67A,
0x2307, 0x16A3, 0x484F, 0x7DEB, 0xF597, 0xC033, 0x9EDF, 0xAB7B,
0x6808, 0x5DAC, 0x0340, 0x36E4, 0xBE98, 0x8B3C, 0xD5D0, 0xE074,
0x6509, 0x50AD, 0x0E41, 0x3BE5, 0xB399, 0x863D, 0xD8D1, 0xED75,
0x720A, 0x47AE, 0x1942, 0x2CE6, 0xA49A, 0x913E, 0xCFD2, 0xFA76,
0x7F0B, 0x4AAF, 0x1443, 0x21E7, 0xA99B, 0x9C3F, 0xC2D3, 0xF777,
0x5C0C, 0x69A8, 0x3744, 0x02E0, 0x8A9C, 0xBF38, 0xE1D4, 0xD470,
0x510D, 0x64A9, 0x3A45, 0x0FE1, 0x879D, 0xB239, 0xECD5, 0xD971,
0x460E, 0x73AA, 0x2D46, 0x18E2, 0x909E, 0xA53A, 0xFBD6, 0xCE72,
0x4B0F, 0x7EAB, 0x2047, 0x15E3, 0x9D9F, 0xA83B, 0xF6D7, 0xC373,
0xD010, 0xE5B4, 0xBB58, 0x8EFC, 0x0680, 0x3324, 0x6DC8, 0x586C,
0xDD11, 0xE8B5, 0xB659, 0x83FD, 0x0B81, 0x3E25, 0x60C9, 0x556D,
0xCA12, 0xFFB6, 0xA15A, 0x94FE, 0x1C82, 0x2926, 0x77CA, 0x426E,
0xC713, 0xF2B7, 0xAC5B, 0x99FF, 0x1183, 0x2427, 0x7ACB, 0x4F6F,
0xE414, 0xD1B0, 0x8F5C, 0xBAF8, 0x3284, 0x0720, 0x59CC, 0x6C68,
0xE915, 0xDCB1, 0x825D, 0xB7F9, 0x3F85, 0x0A21, 0x54CD, 0x6169,
0xFE16, 0xCBB2, 0x955E, 0xA0FA, 0x2886, 0x1D22, 0x43CE, 0x766A,
0xF317, 0xC6B3, 0x985F, 0xADFB, 0x2587, 0x1023, 0x4ECF, 0x7B6B,
0xB818, 0x8DBC, 0xD350, 0xE6F4, 0x6E88, 0x5B2C, 0x05C0, 0x3064,
0xB519, 0x80BD, 0xDE51, 0xEBF5, 0x6389, 0x562D, 0x08C1, 0x3D65,
0xA21A, 0x97BE, 0xC952, 0xFCF6, 0x748A, 0x412E, 0x1FC2, 0x2A66,
0xAF1B, 0x9ABF, 0xC453, 0xF1F7, 0x798B, 0x4C2F, 0x12C3, 0x2767,
0x8C1C, 0xB9B8, 0xE754, 0xD2F0, 0x5A8C, 0x6F28, 0x31C4, 0x0460,
0x811D, 0xB4B9, 0xEA55, 0xDFF1, 0x578D, 0x6229, 0x3CC5, 0x0961,
0x961E, 0xA3BA, 0xFD56, 0xC8F2, 0x408E, 0x752A, 0x2BC6, 0x1E62,
0x9B1F, 0xAEBB, 0xF057, 0xC5F3, 0x4D8F, 0x782B, 0x26C7, 0x1363
};
uint16_t calculate_crc(const uint8_t *data, size_t length) {
uint16_t crc = 0xFFFF;
for (size_t i = 0; i < length; i++) {
#if 1
uint8_t idx = (uint8_t)(crc ^ data[i]);
crc = (crc >> 8) ^ crc_table[idx];
#else
uint8_t idx = (uint8_t)((crc >> 8) ^ data[i]);
crc = (crc << 8) ^ crc_table[idx];
#endif
}
return crc ^ 0x0000;
}CRC-16/NRSC-5 is the reflected 16-bit CRC used by the NRSC-5 digital radio broadcast standard.
CRC-16/NRSC-5 is a 16-bit CRC model defined by polynomial 0x080B, an initial register value of 0xFFFF, and final XOR 0x0000. It processes reflected input bytes and reports a reflected output.
Documented application context for this model includes NRSC-5, HD Radio, Digital broadcast. The calculator above applies this exact parameter set to the current input; the published Check value below is instead the fixed verification result for ASCII 123456789.
CRC implementations are commonly verified with the ASCII input 123456789.
A model is identified by its complete parameter set, not its polynomial alone.
Continue with the main calculator, browse the algorithm catalog, compare models in the Algorithm Reference section, or generate a lookup table.
| Parameter | Value | Meaning | Reference |
|---|---|---|---|
| Width | 16 bits | CRC register and result width | Read guide |
| Poly | 0x080B | Generator polynomial without the leading term | Read guide |
| Init | 0xFFFF | Initial CRC register value | Read guide |
| RefIn | Yes | Reflect each input byte before processing | Read guide |
| RefOut | Yes | Reflect the register before XOR Out | Read guide |
| XorOut | 0x0000 | Final value XORed with the CRC register | Read guide |
| Check | 0xA066 | CRC of ASCII “123456789” | Read guide |
| Residue | Not listed | Expected residue after appending a valid CRC | Read guide |
For the standard ASCII test input 123456789, the check value of CRC-16/NRSC-5 is 0xA066.
CRC-16/NRSC-5 uses the 16-bit polynomial 0x080B.
For CRC-16/NRSC-5, RefIn is Yes and RefOut is Yes.
The closest published model by parameter overlap is CRC-16/MCRF4XX, differing from CRC-16/NRSC-5 in polynomial.