https://github.com/fbiego/crc16modbus
CRC16-MODBUS Checksum calculator, Kotlin
https://github.com/fbiego/crc16modbus
android checksum checksum-calculation crc16 kotlin modbus
Last synced: 5 months ago
JSON representation
CRC16-MODBUS Checksum calculator, Kotlin
- Host: GitHub
- URL: https://github.com/fbiego/crc16modbus
- Owner: fbiego
- Created: 2020-12-14T10:24:02.000Z (almost 5 years ago)
- Default Branch: main
- Last Pushed: 2020-12-14T10:35:01.000Z (almost 5 years ago)
- Last Synced: 2025-03-31T10:11:09.645Z (6 months ago)
- Topics: android, checksum, checksum-calculation, crc16, kotlin, modbus
- Language: Kotlin
- Homepage:
- Size: 2.93 KB
- Stars: 8
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CRC16Modbus
### Usage
val bytes = ByteArray(10)
for (x in 0 until 10){
bytes[9-x] = x.toByte()
}
val crc = CRC16Modbus()
crc.update(bytes)
val checkSum = crc.crcBytes
println(String.format("CheckSum = 0x%02X, 0x%02X", checkSum[0], checkSum[1]))