kumulant

LongHasher

interface LongHasher(source)

Pluggable Long -> Long mixer used by the discrete sketch family (HyperLogLog, LinearCounting, MinHash, BloomFilter, CountMinSketch) to spread a key's bits across the full 64-bit range before bucketing. Distinct from Hasher64 (ByteArray -> Long): callers reduce a domain key to a Long first (e.g. via hash64), and the sketch then mixes that Long through here.

Implementations must be deterministic and pure, and expose a stable name so a sketch can record which mixer produced its summary on the wire. Register a custom mixer with Hashers.register so Hashers.resolve can rebuild it from a name after deserialization.

Properties

Link copied to clipboard
abstract val name: String

Stable identifier serialized into specs and results, and used as the registry key.

Functions

Link copied to clipboard
abstract fun mix(value: Long): Long

Mix value into a uniformly spread 64-bit hash.

mix

abstract fun mix(value: Long): Long(source)

Mix value into a uniformly spread 64-bit hash.

name

abstract val name: String(source)

Stable identifier serialized into specs and results, and used as the registry key.