private static final class Murmur3_32HashFunction.Murmur3_32Hasher extends AbstractHasher
| Modifier and Type | Field and Description |
|---|---|
private long |
buffer |
private int |
h1 |
private boolean |
isDone |
private int |
length |
private int |
shift |
| Constructor and Description |
|---|
Murmur3_32Hasher(int seed) |
| Modifier and Type | Method and Description |
|---|---|
HashCode |
hash()
Computes a hash code based on the data that have been provided to this hasher.
|
Hasher |
putByte(byte b)
Puts a byte into this sink.
|
Hasher |
putBytes(byte[] bytes,
int off,
int len)
Puts a chunk of an array of bytes into this sink.
|
Hasher |
putBytes(java.nio.ByteBuffer buffer)
Puts the remaining bytes of a byte buffer into this sink.
|
Hasher |
putChar(char c)
Puts a character into this sink.
|
Hasher |
putInt(int i)
Puts an int into this sink.
|
Hasher |
putLong(long l)
Puts a long into this sink.
|
Hasher |
putString(java.lang.CharSequence input,
java.nio.charset.Charset charset)
Equivalent to
putBytes(charSequence.toString().getBytes(charset)). |
private void |
update(int nBytes,
long update) |
putBoolean, putBytes, putDouble, putFloat, putObject, putShort, putUnencodedCharsprivate int h1
private long buffer
private int shift
private int length
private boolean isDone
private void update(int nBytes,
long update)
public Hasher putByte(byte b)
PrimitiveSinkb - a bytepublic Hasher putBytes(byte[] bytes, int off, int len)
PrimitiveSinkbytes[off] is the first byte written,
bytes[off + len - 1] is the last.putBytes in interface HasherputBytes in interface PrimitiveSinkputBytes in class AbstractHasherbytes - a byte arrayoff - the start offset in the arraylen - the number of bytes to writepublic Hasher putBytes(java.nio.ByteBuffer buffer)
PrimitiveSinkbytes.position() is the first
byte written, bytes.limit() - 1 is the last. The position of the buffer will be equal
to the limit when this method returns.putBytes in interface HasherputBytes in interface PrimitiveSinkputBytes in class AbstractHasherbuffer - a byte bufferpublic Hasher putInt(int i)
PrimitiveSinkputInt in interface HasherputInt in interface PrimitiveSinkputInt in class AbstractHasherpublic Hasher putLong(long l)
PrimitiveSinkputLong in interface HasherputLong in interface PrimitiveSinkputLong in class AbstractHasherpublic Hasher putChar(char c)
PrimitiveSinkputChar in interface HasherputChar in interface PrimitiveSinkputChar in class AbstractHasherpublic Hasher putString(java.lang.CharSequence input, java.nio.charset.Charset charset)
HasherputBytes(charSequence.toString().getBytes(charset)).
Warning: This method, which reencodes the input before hashing it, is useful only for
cross-language compatibility. For other use cases, prefer Hasher.putUnencodedChars(java.lang.CharSequence), which is
faster, produces the same output across Java releases, and hashes every char in the
input, even if some are invalid.
putString in interface HasherputString in interface PrimitiveSinkputString in class AbstractHasher