Documentation ¶
Index ¶
Constants ¶
View Source
const POLY uint32 = 0x4C11DB7 // birrev:0xedb88320 (IEEE)
Variables ¶
This section is empty.
Functions ¶
func Crc4 ¶
https://my.oschina.net/iwuyang/blog/198630
CRC4运算 ¶
Poly生成项: 1001,长度为4 - 宽度为 w=3(第一位始终为1,异或时始终为0,所以可忽略第一位)
位串BitString : 11110 - 需借位w 11110 + 000 = 11110000(确保位串每一位都被除一遍)
运算过程: - 运算中只有位串首位为1才运算,否则跳过
11110000 1001|||| - -------------
1100||| 1001||| -
------------
1010|| 1001|| -
-----------
0110| 0000| -
----------
1100 1001 -
---------
101 --> 5,余数 --> The CRC!
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.