Wireshark-dev: Re: [Wireshark-dev] Question about the CCITT/ITU/CRC-16 routine (crc16.c)

From: Richard van der Hoff <richardv@xxxxxxxxxxxxx>
Date: Tue, 12 Dec 2006 15:46:34 +0000
Stig Bjørlykke wrote:
I think I will implement crc16_x25_unreflected() and crc16_x25_ccitt(),
as my table is used a bit different than in crc16_unreflected():

   while (len--)
     crc16 = table[((crc16 >> 8) ^ *buf++) & 0xff] ^ (crc16 << 8);

Actually, I think that's a bug in the existing crc16_unreflected() - which as you can see isn't used (and afair, I have never tested). Better just add the >>8 to the existing crc16_unreflected().


--
Richard van der Hoff <richardv@xxxxxxxxxxxxx>
Telephony Gateways Project Manager
Tel: +44 (0) 845 666 7778
http://www.mxtelecom.com