u16 CRC_16 (char * pchMsg,char wDataLen)
{
u16 wCRCTalbeAbs[] = {0x0000, 0xCC01,0XD801 ,0X1400,0XF001,0X3C00,0X2800,0XE401,0XA001,0X6C00,0X7800,0XB401,0X5000,0X9C01,0X8801,0X4400};
u16 wCRC = 0XFFFF;
uchar i;
char chChar;
for(i = 0; i < wDataLen; i++)
{
chChar = pchMsg[i];
wCRC = (U16)(wCRCTalbeAbs[(chChar ^ wCRC) & 15] ^ ( wCRC >> 4));
wCRC = (U16)(wCRCTalbeAbs[((wCRC >> 4) ^ wCRC) & 15] ^ ( wCRC >> 4));
}
}
求求哪位大神帮忙解释一下?万分感谢!!
|