static long hash4To7Bytes(long len, long first4Bytes, long last4Bytes) { long mul = mul(len); return hashLen16(len + (first4Bytes << 3), last4Bytes, mul); }
static long hash8To16Bytes(long len, long first8Bytes, long last8Bytes) { long mul = mul(len); long a = first8Bytes + K2; long c = rotateRight(last8Bytes, 37) * mul + a; long d = (rotateRight(a, 25) + last8Bytes) * mul; return hashLen16(c, d, mul); }
private <T> long cityHashLen33To64(Access<T> access, T in, long off, long len) { long mul = mul(len); long a = fetch64(access, in, off) * K2; long b = fetch64(access, in, off + 8L); long c = fetch64(access, in, off + len - 24L); long d = fetch64(access, in, off + len - 32L); long e = fetch64(access, in, off + 16L) * K2; long f = fetch64(access, in, off + 24L) * 9L; long g = fetch64(access, in, off + len - 8L); long h = fetch64(access, in, off + len - 16L) * mul; long u = rotateRight(a + g, 43) + (rotateRight(b, 30) + c) * 9L; long v = ((a + g) ^ d) + f + 1L; long w = reverseBytes((u + v) * mul) + h; long x = rotateRight(e + f, 42) + c; long y = (reverseBytes((v + w) * mul) + g) * mul; long z = e + f + c; a = reverseBytes((x + z) * mul + y) + b; b = shiftMix((z + a) * mul + d + h) * mul; return b + x; }
<T> long hashLen17To32(Access<T> access, T in, long off, long len) { long mul = mul(len); long a = fetch64(access, in, off) * K1; long b = fetch64(access, in, off + 8L); long c = fetch64(access, in, off + len - 8L) * mul; long d = fetch64(access, in, off + len - 16L) * K2; return hashLen16(rotateRight(a + b, 43) + rotateRight(c, 30) + d, a + rotateRight(b + K2, 18) + c, mul); }
private <T> long naHashLen33To64(Access<T> access, T in, long off, long len) { long mul = mul(len); long a = fetch64(access, in, off) * K2; long b = fetch64(access, in, off + 8L); long c = fetch64(access, in, off + len - 8) * mul; long d = fetch64(access, in, off + len - 16) * K2; long y = rotateRight(a + b, 43) + rotateRight(c, 30) + d; long z = hashLen16(y, a + rotateRight(b + K2, 18) + c, mul); long e = fetch64(access, in, off + 16) * mul; long f = fetch64(access, in, off + 24); long g = (y + fetch64(access, in, off + len - 32)) * mul; long h = (z + fetch64(access, in, off + len - 24)) * mul; return hashLen16(rotateRight(e + f, 43) + rotateRight(g, 30) + h, e + rotateRight(f + a, 18) + g, mul); }