List of utility methods to do Integer Hash
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 i) int Hash return (i << 16) | (i >>> 16);
|
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(int number, int max) int Hash int hash = number % max; return hash < 0 ? hash * -1 : hash; |
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; |
int | intHashCode(int i) int Hash Code return i;
|
long | intHashToLong(int hash) int Hash To Long return (long) hash; |