CRC16的代码段
来源:互联网 发布:ubuntu输入法不对 编辑:程序博客网 时间:2024/05/21 18:30
/* @func crc16
* @input array pointer and numbers of array
* @output crc result
******************************************************************************
* @description
*
*
*
******************************************************************************
*/
uint16_t crc16(uint8_t *p, uint8_t num)
{
uint8_t i,j,k;
uint16_t crc16;
crc16 = 0xffff;
for(j = 0;j < num;j++)
{
crc16 ^= *p++;
for(i = 0;i < 8;i++)
{
k = crc16&0x01;
crc16 >>= 1;
if(k) crc16 ^= 0xa001;
}
}
return crc16;
}
* @input array pointer and numbers of array
* @output crc result
******************************************************************************
* @description
*
*
*
******************************************************************************
*/
uint16_t crc16(uint8_t *p, uint8_t num)
{
uint8_t i,j,k;
uint16_t crc16;
crc16 = 0xffff;
for(j = 0;j < num;j++)
{
crc16 ^= *p++;
for(i = 0;i < 8;i++)
{
k = crc16&0x01;
crc16 >>= 1;
if(k) crc16 ^= 0xa001;
}
}
return crc16;
}
阅读全文
0 0
- CRC16的代码段
- CRC16校验的C代码
- Java CRC16 校验代码 和 与之对应的C代码
- CRC16校验代码
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 数据段、代码段、堆栈段、BSS段的区别
- 笔试面试高频题(C/C++)
- Ubuntu kindle_inject进程占用CPU过高的解决办法
- 设计模式之——Java版总览
- 什么是Intent
- VMware上centos网卡配置
- CRC16的代码段
- CodeForces 711A A. Bus to Udayland
- JavaScript学习总结(九)——Javascript面向(基于)对象编程
- 基本数据类型
- 新的Javadoc标签@apiNote,@implSpec和@implNote
- Codeforces Round #432 (Div. 2, based on IndiaHacks Final Round 2017)C. Five Dimensional Points
- Flume中使用KafkaChannel时topic中存在异常奇怪字符
- 知乎爬虫(一)
- 触摸[1] MotionEvent