final class Murmur3_32HashFunction extends AbstractStreamingHashFunction implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
private static class |
Murmur3_32HashFunction.Murmur3_32Hasher |
AbstractStreamingHashFunction.AbstractStreamingHasher
Modifier and Type | Field and Description |
---|---|
private static int |
C1 |
private static int |
C2 |
private int |
seed |
private static long |
serialVersionUID |
Constructor and Description |
---|
Murmur3_32HashFunction(int seed) |
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.
|
boolean |
equals(java.lang.Object object) |
private static HashCode |
fmix(int h1,
int length) |
int |
hashCode() |
HashCode |
hashInt(int input)
Shortcut for
newHasher().putInt(input).hash() ; returns the hash code for the given
int value, interpreted in little-endian byte order. |
HashCode |
hashLong(long input)
Shortcut for
newHasher().putLong(input).hash() ; returns the hash code for the
given long value, interpreted in little-endian byte order. |
HashCode |
hashUnencodedChars(java.lang.CharSequence input)
Shortcut for
newHasher().putUnencodedChars(input).hash() . |
private static int |
mixH1(int h1,
int k1) |
private static int |
mixK1(int k1) |
Hasher |
newHasher()
Begins a new hash code computation by returning an initialized, stateful
Hasher instance that is ready to receive data. |
java.lang.String |
toString() |
hashBytes, hashBytes, hashObject, hashString, newHasher
private static final int C1
private static final int C2
private final int seed
private static final long serialVersionUID
public int bits()
HashFunction
bits
in interface HashFunction
public Hasher newHasher()
HashFunction
Hasher
instance that is ready to receive data. Example:
HashFunction hf = Hashing.md5();
HashCode hc = hf.newHasher()
.putLong(id)
.putBoolean(isActive)
.hash();
newHasher
in interface HashFunction
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(@Nullable java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public HashCode hashInt(int input)
HashFunction
newHasher().putInt(input).hash()
; returns the hash code for the given
int
value, interpreted in little-endian byte order. The implementation might
perform better than its longhand equivalent, but should not perform worse.hashInt
in interface HashFunction
hashInt
in class AbstractStreamingHashFunction
public HashCode hashLong(long input)
HashFunction
newHasher().putLong(input).hash()
; returns the hash code for the
given long
value, interpreted in little-endian byte order. The implementation
might perform better than its longhand equivalent, but should not perform worse.hashLong
in interface HashFunction
hashLong
in class AbstractStreamingHashFunction
public HashCode hashUnencodedChars(java.lang.CharSequence input)
HashFunction
newHasher().putUnencodedChars(input).hash()
. The implementation
might perform better than its longhand equivalent, but should not perform worse.
Note that no character encoding is performed; the low byte and high byte of each char
are hashed directly (in that order).hashUnencodedChars
in interface HashFunction
hashUnencodedChars
in class AbstractStreamingHashFunction
private static int mixK1(int k1)
private static int mixH1(int h1, int k1)
private static HashCode fmix(int h1, int length)