List of utility methods to do Hash Code Calculate
int | hashCode(int[] ai) hash Code int hashcode = 0; for (int i : ai) { hashcode = hashcode * 31 + i; return hashcode; |
int | hashCode(int[] array) Returns a hash code value for the array final int prime = 31; if (array == null) return 0; int result = 1; for (int index = 0; index < array.length; index++) { result = (prime * result) + array[index]; return result; ... |
int | hashCode(int[][] arrays) hash Code if (arrays == null) { return 0; int result = 1; int h = arrays.length; int w = arrays[0].length; int value = 0; for (int i = 0; i < h; i++) { ... |
int | hashCode(Iterable> iterable) Generates a Object#hashCode() for a given Iterable and its elements. final int prime = 31; int result = 1; if (iterable != null) { for (Object object : iterable) { result = prime * result + ((object == null) ? 0 : object.hashCode()); return result; ... |
int | hashCode(long a[]) Returns a hash code based on the contents of the specified array. if (a == null) return 0; int result = 1; for (long element : a) { int elementHash = (int) (element ^ (element >>> 32)); result = 31 * result + elementHash; return result; ... |
int | hashCode(long longVal) Get standard Java hashCode for a long without the extra object creation. return (int) (longVal ^ (longVal >>> 32)); |
int | hashCode(long value) Return a hash code of the given long integer value. return (int) (value ^ (value >>> Integer.SIZE)); |
int | hashCode(long x) Compute a hash code for the given bitset. long hash = 0x76543210L ^ x; return (int) ((hash >> 32) ^ hash); |
int | hashCode(long[] a, int fromIndex, int toIndex) hash Code int hashCode = 1; int i = fromIndex; while (i < toIndex) { long v = a[i]; hashCode = 31 * hashCode + (int) (v ^ (v >>> 32)); ++i; return hashCode; ... |
int | hashCode(Object a) Get the hashCode of an object. try { return a.hashCode(); } catch (NullPointerException ex) { if (a == null) { return 0; } else { throw ex; |