API Reference › Hash › Hash.mix64
method

Hash.mix64

Hash.mix64(x) -> long

The 64-bit counterpart of Hash.mix: the MurmurHash3 fmix64 finalizer (shift by 33, multiply, repeat). It thoroughly scrambles a long, so consecutive or structured inputs map to unrelated-looking outputs — ideal for turning a large counter, packed coordinate, or 64-bit id into a random-looking seed. An int argument widens to 64 bits first. Deterministic; Hash.mix64(0) is 0.

Parameters

xthe integer to avalanche (widened to long)

Example

program Seeds64 {
  entry {
    let base: long = Hash.of64("chunk")
    print(Hash.mix64(base))
    print(Hash.mix64(base + 1))   # a neighbouring input -> an unrelated seed
  }
}
← All symbols