final class Fingerprint2011 extends AbstractNonStreamingHashFunction
Hashing.fingerprint2011()
for information on the behaviour of the algorithm.
On Intel Core2 2.66, on 1000 bytes, fingerprint2011 takes 0.9 microseconds compared to fingerprint at 4.0 microseconds and md5 at 4.5 microseconds.
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 |
---|---|
(package private) static HashFunction |
FINGERPRINT_2011 |
private static long |
K0 |
private static long |
K1 |
private static long |
K2 |
private static long |
K3 |
Constructor and Description |
---|
Fingerprint2011() |
Modifier and Type | Method and Description |
---|---|
int |
bits()
Returns the number of bits (a multiple of 32) that each hash code produced by this hash
function has.
|
(package private) static long |
fingerprint(byte[] bytes,
int offset,
int length) |
private static long |
fullFingerprint(byte[] bytes,
int offset,
int length) |
(package private) static long |
hash128to64(long high,
long low)
Implementation of Hash128to64 from util/hash/hash128to64.h
|
HashCode |
hashBytes(byte[] input,
int off,
int len)
Shortcut for
newHasher().putBytes(input, off, len).hash() . |
private static long |
hashLength33To64(byte[] bytes,
int offset,
int length) |
(package private) static long |
murmurHash64WithSeed(byte[] bytes,
int offset,
int length,
long seed) |
private static long |
shiftMix(long val) |
java.lang.String |
toString() |
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.
|
hashBytes, hashInt, hashLong, hashString, hashUnencodedChars, newHasher, newHasher
hashBytes, hashObject
static final HashFunction FINGERPRINT_2011
private static final long K0
private static final long K1
private static final long K2
private static final long K3
public HashCode hashBytes(byte[] input, int off, int len)
HashFunction
newHasher().putBytes(input, off, len).hash()
. The implementation
might perform better than its longhand equivalent, but should not perform worse.hashBytes
in interface HashFunction
hashBytes
in class AbstractNonStreamingHashFunction
public int bits()
HashFunction
public java.lang.String toString()
toString
in class java.lang.Object
static long fingerprint(byte[] bytes, int offset, int length)
private static long shiftMix(long val)
static long hash128to64(long high, long low)
private static void weakHashLength32WithSeeds(byte[] bytes, int offset, long seedA, long seedB, long[] output)
private static long fullFingerprint(byte[] bytes, int offset, int length)
private static long hashLength33To64(byte[] bytes, int offset, int length)
static long murmurHash64WithSeed(byte[] bytes, int offset, int length, long seed)