Package com.google.common.hash
Class SipHashFunction.SipHasher
java.lang.Object
com.google.common.hash.AbstractHasher
com.google.common.hash.AbstractStreamingHasher
com.google.common.hash.SipHashFunction.SipHasher
- All Implemented Interfaces:
Hasher,PrimitiveSink
- Enclosing class:
SipHashFunction
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected HashCodemakeHash()Computes a hash code based on the data that have been provided to this hasher.protected voidprocess(ByteBuffer buffer) Processes the available bytes of the buffer (at mostchunkbytes).private voidprocessM(long m) protected voidprocessRemaining(ByteBuffer buffer) This is invoked for the last bytes of the input, which are not enough to fill a whole chunk.private voidsipRound(int iterations) Methods inherited from class com.google.common.hash.AbstractStreamingHasher
hash, putByte, putBytes, putBytes, putChar, putInt, putLong, putShortMethods inherited from class com.google.common.hash.AbstractHasher
putBoolean, putBytes, putDouble, putFloat, putObject, putString, putUnencodedChars
-
Field Details
-
CHUNK_SIZE
private static final int CHUNK_SIZE- See Also:
-
c
private final int c -
d
private final int d -
v0
private long v0 -
v1
private long v1 -
v2
private long v2 -
v3
private long v3 -
b
private long b -
finalM
private long finalM
-
-
Constructor Details
-
SipHasher
SipHasher(int c, int d, long k0, long k1)
-
-
Method Details
-
process
Description copied from class:AbstractStreamingHasherProcesses the available bytes of the buffer (at mostchunkbytes).- Specified by:
processin classAbstractStreamingHasher
-
processRemaining
Description copied from class:AbstractStreamingHasherThis is invoked for the last bytes of the input, which are not enough to fill a whole chunk. The passedByteBufferis guaranteed to be non-empty.This implementation simply pads with zeros and delegates to
AbstractStreamingHasher.process(ByteBuffer).- Overrides:
processRemainingin classAbstractStreamingHasher
-
makeHash
Description copied from class:AbstractStreamingHasherComputes a hash code based on the data that have been provided to this hasher. This is called after all chunks are handled withAbstractStreamingHasher.process(java.nio.ByteBuffer)and any leftover bytes that did not make a complete chunk are handled withAbstractStreamingHasher.processRemaining(java.nio.ByteBuffer).- Specified by:
makeHashin classAbstractStreamingHasher
-
processM
private void processM(long m) -
sipRound
private void sipRound(int iterations)
-