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 intprivate final intprivate final longprivate final longprivate static final long(package private) static final HashFunction -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintbits()Returns the number of bits (a multiple of 32) that each hash code produced by this hash function has.booleaninthashCode()Begins a new hash code computation by returning an initialized, statefulHasherinstance 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:HashFunctionReturns the number of bits (a multiple of 32) that each hash code produced by this hash function has.- Specified by:
bitsin interfaceHashFunction
-
newHasher
Description copied from interface:HashFunctionBegins a new hash code computation by returning an initialized, statefulHasherinstance that is ready to receive data. Example:HashFunction hf = Hashing.md5(); HashCode hc = hf.newHasher() .putLong(id) .putBoolean(isActive) .hash();- Specified by:
newHasherin interfaceHashFunction
-
toString
-
equals
-
hashCode
public int hashCode()
-