https://github.com/itmisx/crc
crc校验包,支持crc8和crc16,主要用于iot应用,检查数据的完整性
https://github.com/itmisx/crc
crc crc16 crc8
Last synced: 7 months ago
JSON representation
crc校验包,支持crc8和crc16,主要用于iot应用,检查数据的完整性
- Host: GitHub
- URL: https://github.com/itmisx/crc
- Owner: itmisx
- License: mit
- Created: 2021-12-09T15:08:54.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-12-11T10:28:37.000Z (almost 4 years ago)
- Last Synced: 2025-01-24T04:46:35.291Z (9 months ago)
- Topics: crc, crc16, crc8
- Language: Go
- Homepage:
- Size: 3.91 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# crc
crc 校验在物联网数据校验中经常使用,这里封装了crc8和crc16的计算方法。
#### install
`go get -u github.com/itmisx/crc`
#### example
````go
// crc8
var data = []byte{0x01,0x02}
crc8 := crc.Crc8(data)
// crc16
var data = []byte{0x01,0x02}
crc16 := crc.Crc16(data)
````