分享一个crc的库

[复制链接]
1989|15
 楼主| dirtwillfly 发表于 2016-5-18 10:05 | 显示全部楼层 |阅读模式

库提供了下面函数:
  1. /* Does the CRC calculation over a string specified by length (allows 00 inside string) */
  2. uint8_t calculate_crc8_itu(char *p, unsigned int length);
  3. uint8_t calculate_crc8_atm(char *p, unsigned int length);
  4. uint8_t calculate_crc8_ccitt(char *p, unsigned int length);
  5. uint8_t calculate_crc8_maxim(char *p, unsigned int length);
  6. uint8_t calculate_crc8(char *p, unsigned int length);
  7. uint8_t calculate_crc8_icode(char *p, unsigned int length);
  8. uint8_t calculate_crc8_j1850(char *p, unsigned int length);
  9. uint8_t calculate_crc8_wcdma(char *p, unsigned int length);
  10. uint8_t calculate_crc8_rohc(char *p, unsigned int length);
  11. uint8_t calculate_crc8_darc(char *p, unsigned int length);

  12. uint16_t calculate_crc16_Buypass(char *p, unsigned int length);
  13. uint16_t calculate_crc16_DDS_110(char *p, unsigned int length);
  14. uint16_t calculate_crc16_EN_13757(char *p, unsigned int length);
  15. uint16_t calculate_crc16_Teledisk(char *p, unsigned int length);
  16. uint16_t calculate_crc16(char *p, unsigned int length);
  17. uint16_t calculate_crc16_Modbus(char *p, unsigned int length);
  18. uint16_t calculate_crc16_Maxim(char *p, unsigned int length);
  19. uint16_t calculate_crc16_USB(char *p, unsigned int length);
  20. uint16_t calculate_crc16_T10_DIF(char *p, unsigned int length);
  21. uint16_t calculate_crc16_Dect_X(char *p, unsigned int length);
  22. uint16_t calculate_crc16_Dect_R(char *p, unsigned int length);
  23. uint16_t calculate_crc16_sick(char *p, unsigned int length);
  24. uint16_t calculate_crc16_DNP(char *p, unsigned int length);
  25. uint16_t calculate_crc16_Ccitt_Xmodem(char *p, unsigned int length);
  26. uint16_t calculate_crc16_Ccitt_FFFF(char *p, unsigned int length);
  27. uint16_t calculate_crc16_Ccitt_1D0F(char *p, unsigned int length);
  28. uint16_t calculate_crc16_Genibus(char *p, unsigned int length);
  29. uint16_t calculate_crc16_Kermit(char *p, unsigned int length);
  30. uint16_t calculate_crc16_X25(char *p, unsigned int length);
  31. uint16_t calculate_crc16_MCRF4XX(char *p, unsigned int length);
  32. uint16_t calculate_crc16_Riello(char *p, unsigned int length);
  33. uint16_t calculate_chk16_Fletcher(char *p, unsigned int length);

  34. uint32_t calculate_crc24_flexray_a(char *p, unsigned int length);
  35. uint32_t calculate_crc24_flexray_b(char *p, unsigned int length);
  36. uint32_t calculate_crc24_r64(char *p, unsigned int length);
  37. uint32_t calculate_crc32(char *p, unsigned int length);
  38. uint32_t calculate_crc32_jamcrc(char *p, unsigned int length);
  39. uint32_t calculate_crc32_c(char *p, unsigned int length);
  40. uint32_t calculate_crc32_d(char *p, unsigned int length);
  41. uint32_t calculate_crc32_bzip2(char *p, unsigned int length);
  42. uint32_t calculate_crc32_mpeg2(char *p, unsigned int length);
  43. uint32_t calculate_crc32_posix(char *p, unsigned int length);
  44. uint32_t calculate_crc32_k(char *p, unsigned int length);
  45. uint32_t calculate_crc32_q(char *p, unsigned int length);
  46. uint32_t calculate_crc32_xfer(char *p, unsigned int length);
  47. uint64_t calculate_crc40_gsm(char *p, unsigned int length);
  48. uint64_t calculate_crc64(char *p, unsigned int length);
  49. uint64_t calculate_crc64_1b(char *p, unsigned int length);
  50. uint64_t calculate_crc64_we(char *p, unsigned int length);
  51. uint64_t calculate_crc64_jones(char *p, unsigned int length);


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| dirtwillfly 发表于 2016-5-18 14:10 | 显示全部楼层
djz1992 发表于 2016-5-18 15:58 | 显示全部楼层
 楼主| dirtwillfly 发表于 2016-5-18 16:04 | 显示全部楼层

不谢。我最近也在用这个库。
firstblood 发表于 2016-5-18 19:22 | 显示全部楼层
这个库非常全面的,在做函数的时候适当调用即可
hotpower 发表于 2016-6-21 15:34 来自手机 | 显示全部楼层
http://www.21ic.com/tools/HotWC3_V1.22.html
 楼主| dirtwillfly 发表于 2016-6-21 15:56 | 显示全部楼层
hotpower 发表于 2016-6-21 15:34
http://www.21ic.com/tools/HotWC3_V1.22.html

mmbs 发表于 2016-6-21 16:35 | 显示全部楼层
这个的运行效率怎么样的
mmbs 发表于 2016-6-21 16:38 | 显示全部楼层
以前用过单独的位运算写的。
hotpower 发表于 2017-8-15 17:50 | 显示全部楼层
firstblood 发表于 2017-8-16 21:59 | 显示全部楼层
这CRC校验的需要看具体的应用环境的
hotpower 发表于 2017-8-23 23:04 | 显示全部楼层
hotwc3可以利用“四点攻击”全部**这些库。(俺不需要看库的源代码)
suolong 发表于 2018-5-16 16:13 | 显示全部楼层
tianxj01 发表于 2019-1-3 10:28 | 显示全部楼层
这个可以有,从8-32,而且类型齐全,非常牛,偶尔用到,可以直接调用。必须顶
51xlf 发表于 2019-1-14 15:47 | 显示全部楼层
用法怎么使用的?     

评论

包含头文件,然后直接调用函数就可以  发表于 2019-1-14 16:28
您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:欢迎进入TI MCU论坛      21ic TI技术交流1群:61549143(已满),  21ic TI技术交流2群:311421422 我的博客:http://blog.timcu.com/

1199

主题

35121

帖子

1122

粉丝
快速回复 在线客服 返回列表 返回顶部