RosettaCodeData/Task/CRC-32/Kotlin/crc-32.kts
2024-10-16 18:07:41 -07:00

12 lines
295 B
Kotlin

// version 1.0.6
import java.util.zip.CRC32
fun main(args: Array<String>) {
val text = "The quick brown fox jumps over the lazy dog"
val crc = CRC32()
with (crc) {
update(text.toByteArray())
println("The CRC-32 checksum of '$text' = ${"%x".format(value)}")
}
}