Java Utililty Methods Hash Calculate

List of utility methods to do Hash Calculate

Description

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

Method

inthash(int state1, int state2, int numStates1)
hash
return state1 + numStates1 * state2;
inthash(int val)
hash
return FNVhash32(val);
inthash(int value)
hash
return (value * KnuthsAValue) >>> (INT_SIZE - K);
inthash(int x, int y)
hash
int h = 31;
h = h * 97 + x;
h *= 17;
h = h * 97 + y;
h *= 17;
return h;
longhash(long key)
hash
key ^= key >>> 33;
key *= 0xff51afd7ed558ccdL;
key ^= key >>> 33;
key *= 0xc4ceb9fe1a85ec53L;
key ^= key >>> 33;
return key;
longhash(long mover, long enemy)
Hash 2 longs into a single long, using a mixing function derived from Murmur.
final long a = murmurMix(mover ^ murmurMix(enemy));
return a ^ (a >>> 47);
inthash(Object a, Object b)
hash
return hashCombine(a.hashCode(), b.hashCode());
inthash(Object key, int limit)
hash
if (limit == 1) {
    return 0;
int hashValue = hash(key.hashCode());
if (hashValue == Integer.MIN_VALUE) {
    hashValue -= 1;
hashValue = Math.abs(hashValue);
...
inthash(Object o)
hash
return o == null ? 0 : o.hashCode();
inthash(Object obj)
hash
final int prime = 31;
int result = 1;
result = prime * result + ((obj == null) ? 0 : obj.hashCode());
return result;