Its speed is comparable to CityHash64, and its quality of hashing is at least as good.
Note to maintainers: This implementation relies on signed arithmetic being bit-wise equivalent to unsigned arithmetic in all cases except:
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final HashFunction | |
| private static final long | |
| private static final long | |
| private static final long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public int | bits()
Implements com. |
| pack-priv static long | |
| public HashCode | hashBytes(byte[] input, int off, int len)
Implements abstract com. Implements com. newHasher().putBytes(input, off, len).hash().
|
| private static long | |
| private static long | |
| private static long | |
| private static long | |
| private static long | |
| private static long | |
| public String | |
| private static void | weakHashLength32WithSeeds(byte[] bytes, int offset, long seedA, long seedB, long[] output)
Computes intermediate hash of 32 bytes of byte array from the given offset. |
| FARMHASH_FINGERPRINT_64 | back to summary |
|---|---|
| pack-priv static final HashFunction FARMHASH_FINGERPRINT_64 | |
| K0 | back to summary |
|---|---|
| private static final long K0 | |
| K1 | back to summary |
|---|---|
| private static final long K1 | |
| K2 | back to summary |
|---|---|
| private static final long K2 | |
| FarmHashFingerprint64 | back to summary |
|---|---|
| pack-priv FarmHashFingerprint64() | |
| bits | back to summary |
|---|---|
| public int bits() Implements com. Doc from com. Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.
| |
| fingerprint | back to summary |
|---|---|
pack-priv static long fingerprint(byte[] bytes, int offset, int length)
| |
| hashBytes | back to summary |
|---|---|
| public HashCode hashBytes(byte[] input, int off, int len) Implements abstract com. Implements com. Doc from com. Shortcut for
| |
| hashLength0to16 | back to summary |
|---|---|
| private static long hashLength0to16(byte[] bytes, int offset, int length) | |
| hashLength16 | back to summary |
|---|---|
| private static long hashLength16(long u, long v, long mul) | |
| hashLength17to32 | back to summary |
|---|---|
| private static long hashLength17to32(byte[] bytes, int offset, int length) | |
| hashLength33To64 | back to summary |
|---|---|
| private static long hashLength33To64(byte[] bytes, int offset, int length) | |
| hashLength65Plus | back to summary |
|---|---|
| private static long hashLength65Plus(byte[] bytes, int offset, int length) | |
| shiftMix | back to summary |
|---|---|
| private static long shiftMix(long val) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| weakHashLength32WithSeeds | back to summary |
|---|---|
| private static void weakHashLength32WithSeeds(byte[] bytes, int offset, long seedA, long seedB, long[] output) Computes intermediate hash of 32 bytes of byte array from the given offset. Results are returned in the output array because when we last measured, this was 12% faster than allocating new arrays every time. | |