Package com.google.common.hash
Class Murmur3_128HashFunction.Murmur3_128Hasher
java.lang.Object
com.google.common.hash.AbstractHasher
com.google.common.hash.AbstractStreamingHasher
com.google.common.hash.Murmur3_128HashFunction.Murmur3_128Hasher
- All Implemented Interfaces:
Hasher
,PrimitiveSink
- Enclosing class:
Murmur3_128HashFunction
private static final class Murmur3_128HashFunction.Murmur3_128Hasher
extends AbstractStreamingHasher
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
bmix64
(long k1, long k2) private static long
fmix64
(long k) protected HashCode
makeHash()
Computes a hash code based on the data that have been provided to this hasher.private static long
mixK1
(long k1) private static long
mixK2
(long k2) protected void
process
(ByteBuffer bb) Processes the available bytes of the buffer (at mostchunk
bytes).protected void
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.AbstractStreamingHasher
hash, putByte, putBytes, putBytes, putChar, putInt, putLong, putShort
Methods 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:
-
C1
private static final long C1- See Also:
-
C2
private static final long C2- See Also:
-
h1
private long h1 -
h2
private long h2 -
length
private int length
-
-
Constructor Details
-
Murmur3_128Hasher
Murmur3_128Hasher(int seed)
-
-
Method Details
-
process
Description copied from class:AbstractStreamingHasher
Processes the available bytes of the buffer (at mostchunk
bytes).- Specified by:
process
in classAbstractStreamingHasher
-
bmix64
private void bmix64(long k1, long k2) -
processRemaining
Description copied from class: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
AbstractStreamingHasher.process(ByteBuffer)
.- Overrides:
processRemaining
in classAbstractStreamingHasher
-
makeHash
Description copied from class:AbstractStreamingHasher
Computes 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:
makeHash
in classAbstractStreamingHasher
-
fmix64
private static long fmix64(long k) -
mixK1
private static long mixK1(long k1) -
mixK2
private static long mixK2(long k2)
-