@Override public long hashInt(int input) { input = NATIVE_CITY.toLittleEndian(input); long unsignedInt = Primitives.unsignedInt(input); long hash = hash4To7Bytes(4L, unsignedInt, unsignedInt); return finalizeHash(hash); }
private <T> long hashLen0To16(ReadAccess<T> access, T in, long off, long len) { if (len >= 8L) { long a = fetch64(access, in, off); long b = fetch64(access, in, off + len - 8L); return hash8To16Bytes(len, a, b); } else if (len >= 4L) { long a = Primitives.unsignedInt(fetch32(access, in, off)); long b = Primitives.unsignedInt(fetch32(access, in, off + len - 4L)); return hash4To7Bytes(len, a, b); } else if (len > 0L) { int a = access.readUnsignedByte(in, off); int b = access.readUnsignedByte(in, off + (len >> 1)); int c = access.readUnsignedByte(in, off + len - 1L); return hash1To3Bytes((int) len, a, b, c); } return K2; }