Package com.google.common.hash
Class SipHashFunction
java.lang.Object
com.google.common.hash.AbstractHashFunction
com.google.common.hash.SipHashFunction
- All Implemented Interfaces:
HashFunction
,Serializable
HashFunction
implementation of SipHash-c-d.-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final int
private final int
private final long
private final long
private static final long
(package private) static final HashFunction
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
bits()
Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.boolean
int
hashCode()
Begins a new hash code computation by returning an initialized, statefulHasher
instance that is ready to receive data.toString()
Methods inherited from class com.google.common.hash.AbstractHashFunction
hashBytes, hashBytes, hashBytes, hashInt, hashLong, hashObject, hashString, hashUnencodedChars, newHasher
-
Field Details
-
SIP_HASH_24
-
c
private final int c -
d
private final int d -
k0
private final long k0 -
k1
private final long k1 -
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
SipHashFunction
SipHashFunction(int c, int d, long k0, long k1) - Parameters:
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 key
-
-
Method Details
-
bits
public int bits()Description copied from interface:HashFunction
Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.- Specified by:
bits
in interfaceHashFunction
-
newHasher
Description copied from interface:HashFunction
Begins a new hash code computation by returning an initialized, statefulHasher
instance that is ready to receive data. Example:HashFunction hf = Hashing.md5(); HashCode hc = hf.newHasher() .putLong(id) .putBoolean(isActive) .hash();
- Specified by:
newHasher
in interfaceHashFunction
-
toString
-
equals
-
hashCode
public int hashCode()
-