computeWithRead

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.

This is useful to avoid loading the whole data into memory.

The read function should return the number of bytes read or -1 if there is no more data to read.