The list of methods to do Integer Hash are organized into topic(s).
int
intHash(final long a) If the specified value is in int range, the returned value is identical.
int hash = (int) (a >> 32) + (int) a;
if (a < 0) {
hash++;
return hash;
int
intHash(int input) Redistribute integer identifier keyspace using Knuth's multiplicative method.
long unsignedValue = ((long) input) - Integer.MIN_VALUE;
long unsignedIntMax = (1l << 32);
long unsignedHashValue = ((unsignedValue * 2654435761l) % unsignedIntMax);
return (int) (unsignedHashValue + Integer.MIN_VALUE);
int
intHash(int key) int Hash
key += ~(key << 15);
key ^= (key >>> 10);
key += (key << 3);
key ^= (key >>> 6);
key += ~(key << 11);
key ^= (key >>> 16);
return key;
int
intHash(long a) If the specified value is in int range, the returned value is identical.
if (false) {
int hash = ((int) (a >> 32)) ^ ((int) a);
if (a < 0) {
hash = -hash - 1;
return hash;
int hash = ((int) (a >> 32)) + ((int) a);
...
int
intHashCode(final int value) Create a hash code of an integer value.
int v;
v = (value + 0xad4497fc);
v += ~(v << 9);
v ^= (v >>> 14);
v += (v << 4);
v ^= (v >>> 10);
return v;