List of utility methods to do Hash Calculate
int | hash64to32(long v) hashto v = v = (v << 18) - v - 1; v = v ^ (v >>> 31); v = (v + (v << 2)) + (v << 4); v = v ^ (v >>> 11); v = v + (v << 6); v = v ^ (v >>> 22); return (int) v; |
int | hashAdd(final int left, final int right) hash Add return 37 * (left + right);
|
int | hashAll(Object[] array) finds a hash value which takes into account the value of all elements, such that two object arrays for which Arrays.equals(a1, a2) returns true will hashAll() to the same value int out = 0; for (int i = 0, len = array.length; i < len; ++i) { Object o = array[i]; if (o != null) out ^= o.hashCode(); return out; |
boolean | hasHangulJongSung(char ch) has Hangul Jong Sung return isHangulSyllables(ch) && (ch - 0xAC00) % 28 > 0;
|
int | hashArray(int h, Object[] a) Computes a hash code from an existing hash code and an array of objects (which may be null). if (a == null) { return hash(h, 19690429); if (a.length == 0) { return hash(h, 19690721); for (Object anA : a) { h = hash(h, anA); ... |
int | hashArray(Object[] array) Utility to hash an array. if (null == array) { return 0; int hash = 0; for (Object object : array) { hash ^= hashValue(object); return hash; ... |
int | hashArray(Object[] objs) hash Array int ret = 1; for (int i = 0; i < objs.length; i++) { ret = 31 * ret + (objs[i] == null ? 0 : objs[i].hashCode()); return ret; |
long | hashBerkeleyDB64(byte[] str) A hash function used in Berkeley DB long hash = 0; for (int i = 0; i < str.length; i++) { hash = str[i] + (hash << 6) + (hash << 16) - hash; return hash; |
byte | hashByteArray(byte[] array, int startInclusive, int endExclusive) A utility to allow hashing of a portion of an array without having to copy it. if (array == null) { return 0; int range = endExclusive - startInclusive; if (range < 0) { throw new IllegalArgumentException(startInclusive + " > " + endExclusive); int result = 1; ... |
int | hashBytes(int seed, byte[] data, int offset, int len) hash Bytes int h1 = seed; int count = len; while (count >= 4) { int k1 = (data[offset] & 0x0FF) | (data[offset + 1] & 0x0FF) << 8 | (data[offset + 2] & 0x0FF) << 16 | data[offset + 3] << 24; count -= 4; offset += 4; k1 *= 0xcc9e2d51; ... |