/*
* Copy right :
* File name : CRC16.c
* Author : Roger.luo
* version : V1.0
* Modified date : 2014/6/14
* Description :提供CRC16校验函数采用CRC16-CCITT
*多项式为 x^16 + x^12 + x^5 + 1
*/
//CRC16-CCITT查找表
const unsigned short crc16_table[256] =
{
0x0000,0x1021,0x2042,0x3063,0x4084,0x50a5,0x60c6,0x70e7,
0x8108,0x9129,0xa14a,0xb16b,0xc18c,0xd1ad,0xe1ce,0xf1ef,
0x1231,0x0210,0x3273,0x2252,0x52b5,0x4294,0x72f7,0x62d6,
0x9339,0x8318,0xb37b,0xa35a,0xd3bd,0xc39c,0xf3ff,0xe3de,
0x2462,0x3443,0x0420,0x1401,0x64e6,0x74c7,0x44a4,0x5485,
0xa56a,0xb54b,0x8528,0x9509,0xe5ee,0xf5cf,
查表法的crc校验算法
最新推荐文章于 2024-06-25 00:33:06 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)