The OpenD Programming Language

fmix64

64-bit MurmurHash3-style bit mixer, parameterized.

Pattern is:

ulong fmix64(ulong x)
{
    x = (x ^ (x >>> shift1)) * m1;
    x = (x ^ (x >>> shift2)) * m2;
    return x ^ (x >>> shift3);
}

As long as m1 and m2 are odd each operation is invertible with the consequence that fmix64(a) == fmix64(b) if and only if (a == b).

Good parameters for fmix64 are found empirically. Several sets of <a href="#murmurHash3Mix">suggested parameters</a> are provided.

@nogc nothrow @safe @nogc nothrow pure @safe
ulong
fmix64
(
ulong m1
ulong m2
uint shift1
uint shift2
uint shift3
)
(
ulong x
)

Meta