@Override public long hashVoid() { return MetroHash.finalize((seed() + k2) * k0); }
@Override public long hashByte(byte input) { long h = (seed() + k2) * k0; h += Primitives.unsignedByte(input) * k3; h ^= Long.rotateRight(h, 37) * k1; return MetroHash.finalize(h); }
@Override public <T> long hash(T input, Access<T> access, long off, long len) { long seed = seed(); if (access.byteOrder(input) == LITTLE_ENDIAN) { return MetroHash.INSTANCE.metroHash64(seed, input, access, off, len); } else { return MetroHash.BigEndian.INSTANCE.metroHash64(seed, input, access, off, len); } } }
@Override public long hashShort(short input) { input = NATIVE_METRO.toLittleEndian(input); long h = (seed() + k2) * k0; h += Primitives.unsignedShort(input) * k3; h ^= Long.rotateRight(h, 48) * k1; return MetroHash.finalize(h); }
@Override public long hashInt(int input) { input = NATIVE_METRO.toLittleEndian(input); long h = (seed() + k2) * k0; h += Primitives.unsignedInt(input) * k3; h ^= Long.rotateRight(h, 26) * k1; return MetroHash.finalize(h); }
@Override public long hashLong(long input) { input = NATIVE_METRO.toLittleEndian(input); long h = (seed() + k2) * k0; h += input * k3; h ^= Long.rotateRight(h, 55) * k1; return MetroHash.finalize(h); }