Package com.google.common.hash
Class Murmur3_32HashFunction.Murmur3_32Hasher
- java.lang.Object
-
- com.google.common.hash.AbstractHasher
-
- com.google.common.hash.AbstractStreamingHashFunction.AbstractStreamingHasher
-
- com.google.common.hash.Murmur3_32HashFunction.Murmur3_32Hasher
-
- All Implemented Interfaces:
Hasher
,PrimitiveSink
- Enclosing class:
- Murmur3_32HashFunction
private static final class Murmur3_32HashFunction.Murmur3_32Hasher extends AbstractStreamingHashFunction.AbstractStreamingHasher
-
-
Field Summary
Fields Modifier and Type Field Description private static int
CHUNK_SIZE
private int
h1
private int
length
-
Constructor Summary
Constructors Constructor Description Murmur3_32Hasher(int seed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HashCode
makeHash()
protected void
process(java.nio.ByteBuffer bb)
Processes the available bytes of the buffer (at mostchunk
bytes).protected void
processRemaining(java.nio.ByteBuffer bb)
This is invoked for the last bytes of the input, which are not enough to fill a whole chunk.-
Methods inherited from class com.google.common.hash.AbstractStreamingHashFunction.AbstractStreamingHasher
hash, putByte, putBytes, putBytes, putChar, putInt, putLong, putObject, putShort, putUnencodedChars
-
Methods inherited from class com.google.common.hash.AbstractHasher
putBoolean, putDouble, putFloat, putString
-
-
-
-
Field Detail
-
CHUNK_SIZE
private static final int CHUNK_SIZE
- See Also:
- Constant Field Values
-
h1
private int h1
-
length
private int length
-
-
Method Detail
-
process
protected void process(java.nio.ByteBuffer bb)
Description copied from class:AbstractStreamingHashFunction.AbstractStreamingHasher
Processes the available bytes of the buffer (at mostchunk
bytes).- Specified by:
process
in classAbstractStreamingHashFunction.AbstractStreamingHasher
-
processRemaining
protected void processRemaining(java.nio.ByteBuffer bb)
Description copied from class:AbstractStreamingHashFunction.AbstractStreamingHasher
This is invoked for the last bytes of the input, which are not enough to fill a whole chunk. The passedByteBuffer
is guaranteed to be non-empty.This implementation simply pads with zeros and delegates to
AbstractStreamingHashFunction.AbstractStreamingHasher.process(ByteBuffer)
.- Overrides:
processRemaining
in classAbstractStreamingHashFunction.AbstractStreamingHasher
-
makeHash
public HashCode makeHash()
- Specified by:
makeHash
in classAbstractStreamingHashFunction.AbstractStreamingHasher
-
-