Forum Discussion
Altera_Forum
Honored Contributor
10 years agoFWIW the crc is CRC-CCITT as used by hdlc.
This means the the calculation can be reduced to: crc = 0xffff;
while (p < lim) {
crc ^= *p++;
t = (crc ^ crc << 4) & 0xff;
crc = crc >> 8 ^ t << 8 ^ t << 3 ^ t >> 4;
crc ^= 0xffff;