16 lines
354 B
Kotlin
16 lines
354 B
Kotlin
package bintools
|
|
|
|
import net.sergeych.bintools.CRC
|
|
import net.sergeych.bintools.encodeToHex
|
|
import kotlin.test.Test
|
|
|
|
class CrcTest {
|
|
@Test
|
|
fun testVectors() {
|
|
val x = byteArrayOf(1,2,3,4,5)
|
|
val crc = CRC.crc8(x)
|
|
println("->> ${x.toList()}")
|
|
println("->> ${crc.encodeToHex()}")
|
|
println("->> ${crc}")
|
|
}
|
|
} |