SimpleChecksum

interface SimpleChecksum

Represents a 32-bit checksum interface, for checksums like CRC32 or Adler32

Inheritors

Properties

Link copied to clipboard
abstract val initialValue: Int

Initial value for the checksum.

Functions

Link copied to clipboard
fun SimpleChecksum.compute(data: ByteArray, offset: Int = 0, len: Int = data.size - offset): Int

Computes the checksum of the data determined in the range offset and len.

Link copied to clipboard
inline fun SimpleChecksum.computeWithRead(initial: Int = this.initialValue, read: (buffer: ByteArray) -> Int): Int

Utility to perform a checksum by small chunks of data provided by the read function.

Link copied to clipboard
abstract fun update(old: Int, data: ByteArray, offset: Int = 0, len: Int = data.size - offset): Int

Returns an updated checksum starting with an old checksum, and then updating with a data ByteArray in the range offset and len

Link copied to clipboard