/** * Compute k hashes based on two hashes using * (hash1+i*hash2)%m; * @param value The byte array. * @param m The maximum number of values. * @param k The number of hash values to compute. * @return K hashes. */ public static int[] hashK(byte[] value, int m, int k) { int[] ret = new int[k]; long hash1 = Math.abs(murmur3(value, 0))%m; long hash2 = Math.abs(murmur3(value, (int)hash1))%m; for(int i = 0; i < k; i++) { ret[i] = (int)((hash1+i*hash2)%m); } return ret; }