List of utility methods to do FNV Hash
int | FNVHash(byte[] data) FNV Hash int hash = (int) 2166136261L; for (byte b : data) hash = (hash * 16777619) ^ b; if (M_SHIFT == 0) return hash; return (hash ^ (hash >> M_SHIFT)) & M_MASK; |
int | FNVHash(byte[] data) FNV Hash final int p = 16777619; int hash = (int) 2166136261L; for (byte b : data) hash = (hash ^ b) * p; hash += hash << 13; hash ^= hash >> 7; hash += hash << 3; hash ^= hash >> 17; ... |
int | fnvHash(int[] p) fnv Hash long h = 2166136261L; for (int pi : p) h = (h * 16777619L) ^ (long) pi; return (int) h; |
long | FNVHash(String str) FNV Hash long fnv_prime = 0x811C9DC5; long hash = 0; for (int i = 0; i < str.length(); i++) { hash *= fnv_prime; hash ^= str.charAt(i); return hash; |
int | FNVHash1(byte[] data) FNV Hash final int p = 16777619; int hash = (int) 2166136261L; for (byte b : data) hash = (hash ^ b) * p; hash += hash << 13; hash ^= hash >> 7; hash += hash << 3; hash ^= hash >> 17; ... |
long | FNVhash64(long val) FN Vhash long hashval = FNV_offset_basis_64; for (int i = 0; i < 8; i++) { long octet = val & 0x00ff; val = val >> 8; hashval = hashval ^ octet; hashval = hashval * FNV_prime_64; return Math.abs(hashval); ... |