kumulant

hash64

fun hash64(bytes: ByteArray): Long(source)

64-bit hash of bytes for cardinality / sketch families: SplitMix64 over 8-byte little-endian chunks, folding tail bytes in last and seeding with the input length so zero-prefixed inputs of different lengths hash distinctly. Stable byte-for-byte across platforms.

Prefer this over value.hashCode().toLong() when feeding HLL, BloomFilterStat, or CountMinSketchStat - those rely on uniform 64-bit entropy, and JVM hashCode only provides 32 bits.

Not collision-resistant. Use a cryptographic hash for adversarial input.


fun hash64(value: String): Long(source)

UTF-8 byte hash convenience over hash64.

splitmix64

fun splitmix64(value: Long): Long(source)

SplitMix64 - a fast, high-quality 64-bit mixer suitable for spreading sequential or low-entropy keys into a uniform 64-bit hash before feeding them to cardinality sketches. Output passes BigCrush; not collision-resistant (use a cryptographic hash if adversarial input is a concern).

SplitMix64

Default LongHasher: the library's splitmix64 mixer. Pre-registered with Hashers.