checksum

open fun checksum(    crc: Int,     data: Array<Byte>,     offset: Int,     length: Int): Int

Calculates the checksum on the given data, from the give offset and for the given length, using the given initial value. This allows on to calculate the checksum iteratively, by reinjecting the last returned value as the initial value when the function is called for the next data chunk. The initial value should be 0 for the first iteration.

Return

the checksum.

Parameters

crc

- the initial value

data

- the data

offset

- the offset at which to start calculating the checksum.

length

- the length of data over which to calculate the checksum.