final class SipHashFunction extends AbstractHashFunction implements java.io.Serializable
HashFunction
implementation of SipHash-c-d.Modifier and Type | Class and Description |
---|---|
private static class |
SipHashFunction.SipHasher |
Modifier and Type | Field and Description |
---|---|
private int |
c |
private int |
d |
private long |
k0 |
private long |
k1 |
private static long |
serialVersionUID |
(package private) static HashFunction |
SIP_HASH_24 |
Constructor and Description |
---|
SipHashFunction(int c,
int d,
long k0,
long k1) |
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) |
int |
hashCode() |
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, hashBytes, hashInt, hashLong, hashObject, hashString, hashUnencodedChars, newHasher
static final HashFunction SIP_HASH_24
private final int c
private final int d
private final long k0
private final long k1
private static final long serialVersionUID
SipHashFunction(int c, int d, long k0, long k1)
c
- the number of compression rounds (must be positive)d
- the number of finalization rounds (must be positive)k0
- the first half of the keyk1
- the second half of the keypublic 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(@CheckForNull java.lang.Object object)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object