XxHash32

object XxHash32

xxHash32 (Yann Collet): the checksum used by the LZ4 frame format for its header (HC byte) and optional block/content checks. Pure-Kotlin, one-shot. 32-bit wrapping arithmetic done in Int; the result is exposed unsigned in the low 32 bits of a Long.

Check value: xxHash32("", seed=0) == 0x02CC5D05.

Functions

Link copied to clipboard
fun hash(data: ByteArray, offset: Int = 0, length: Int = data.size, seed: Int = 0): Long

Hash length bytes of data from offset, with seed (LZ4 uses 0).