Java Utililty Methods Murmur Hash

List of utility methods to do Murmur Hash

Description

The list of methods to do Murmur Hash are organized into topic(s).

Method

intMurmurHash3_fmix(int k)
Murmur Hasfmix
k ^= k >>> 16;
k *= 0x85ebca6b;
k ^= k >>> 13;
k *= 0xc2b2ae35;
k ^= k >>> 16;
return k;
intmurmurhash3x8632(byte[] data, int offset, int len, int seed)
This code is public domain.
int c1 = 0xcc9e2d51;
int c2 = 0x1b873593;
int h1 = seed;
int roundedEnd = offset + (len & 0xfffffffc); 
for (int i = offset; i < roundedEnd; i += 4) {
    int k1 = (data[i] & 0xff) | ((data[i + 1] & 0xff) << 8) | ((data[i + 2] & 0xff) << 16)
            | (data[i + 3] << 24);
    k1 *= c1;
...
longmurmurMix(long h)
Index of units char in prefixes
h *= 0xc6a4a7935bd1e995L;
h ^= h >>> 47 | h << 17;
h *= 0xc6a4a7935bd1e995L;
return h;
intmurmurRehash(final int hash)
re-hashes a 4-byte sequence (Java int) using murmur3 hash algorithm.

int k = hash;
k ^= k >>> 16;
k *= 0x85ebca6b;
k ^= k >>> 13;
k *= 0xc2b2ae35;
k ^= k >>> 16;
return k;