Technical information
10/29/2014
Page 68 of 72
© 2014 The Code Corporation
12393 South Gateway Park Place Suite 600, Draper, UT 84020
(801) 495-2200
FAX (801) 495-0280
crc_t crc
( crc_t initialCrc
, const unsigned char* p
, size_t n
)
{
enum
{
crcBits = 16,
charBits = 8,
diffBits = crcBits - charBits
};
crc_t c = initialCrc;
#include "crc16tab.h"
while( n-- )
c = (c << charBits) ^ crcTab[( c >> diffBits ) ^ *p++];
return c;
}
/*eof*/