List of utility methods to do Hash Calculate
int | hash(Object[] array) hash int hash = 0; for (int i = 0; i < array.length; ++i) { Object o = array[i]; hash = combine(hash, hash(o)); return hash; |
int | hash(Object[] state) hash int hash = 0; for (int i = 0; i < state.length; ++i) { hash = hash * 31 + (null == state[i] ? 0 : state[i].hashCode()); return hash; |
int | hash1(int val) hash val = (val + 0x7ed55d16) + (val << 12); val = (val ^ 0xc761c23c) ^ (val >> 19); val = (val + 0x165667b1) + (val << 5); val = (val + 0xd3a2646c) ^ (val << 9); val = (val + 0xfd7046c5) + (val << 3); val = (val ^ 0xb55a4f09) ^ (val >> 16); return val; |
int | hash1(Object a) hash return a != null ? a.hashCode() : 0;
|
int | hash16(int hash) hash return hash & 0xffff ^ hash >>> 16;
|
int | hash3(int hash, Object x, Object y, Object z) Utility method to combine a base hash with the identity hash of one or more objects. return 0x30000000 | (hash + 7 * System.identityHashCode(x) + 11 * System.identityHashCode(y)
+ 13 * System.identityHashCode(z));
|
int | Hash32(byte[] v, int iStart, int iLength) Hash int u = 0x326F637B; if (v == null) { assert false; return u; if (iStart < 0) { assert false; return u; ... |
int | hash32shiftmult(int k) hashshiftmult k = (k ^ 61) ^ (k >>> 16);
k = k + (k << 3);
k = k ^ (k >>> 4);
k = k * 0x27d4eb2d;
k = k ^ (k >>> 15);
return k;
|
long | hash64(final byte[] data, int length) hash return hash64(data, length, 0xe17a1465);
|
int | hash64To32(long lg) hash To return (int) (lg ^ (lg >>> 32)); |