Package com.google.common.hash
Class SipHashFunction
- java.lang.Object
-
- com.google.common.hash.AbstractHashFunction
-
- com.google.common.hash.SipHashFunction
-
- All Implemented Interfaces:
HashFunction
,java.io.Serializable
final class SipHashFunction extends AbstractHashFunction implements java.io.Serializable
HashFunction
implementation of SipHash-c-d.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
SipHashFunction.SipHasher
-
Field Summary
Fields Modifier and Type Field 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 Summary
Constructors Constructor Description SipHashFunction(int c, int d, long k0, long k1)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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, statefulHasher
instance that is ready to receive data.java.lang.String
toString()
-
Methods inherited from class com.google.common.hash.AbstractHashFunction
hashBytes, hashBytes, hashBytes, hashInt, hashLong, hashObject, hashString, hashUnencodedChars, newHasher
-
-
-
-
Field Detail
-
SIP_HASH_24
static final HashFunction 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:
- Constant Field Values
-
-
Method Detail
-
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
public Hasher 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
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-