private static final class SipHashFunction.SipHasher extends AbstractStreamingHasher
Modifier and Type | Field and Description |
---|---|
private long |
b |
private int |
c |
private static int |
CHUNK_SIZE |
private int |
d |
private long |
finalM |
private long |
v0 |
private long |
v1 |
private long |
v2 |
private long |
v3 |
Constructor and Description |
---|
SipHasher(int c,
int d,
long k0,
long k1) |
Modifier and Type | Method and Description |
---|---|
protected HashCode |
makeHash()
Computes a hash code based on the data that have been provided to this hasher.
|
protected void |
process(java.nio.ByteBuffer buffer)
Processes the available bytes of the buffer (at most
chunk bytes). |
private void |
processM(long m) |
protected void |
processRemaining(java.nio.ByteBuffer buffer)
This is invoked for the last bytes of the input, which are not enough to fill a whole chunk.
|
private void |
sipRound(int iterations) |
hash, putByte, putBytes, putBytes, putChar, putInt, putLong, putShort
putBoolean, putBytes, putDouble, putFloat, putObject, putString, putUnencodedChars
private static final int CHUNK_SIZE
private final int c
private final int d
private long v0
private long v1
private long v2
private long v3
private long b
private long finalM
protected void process(java.nio.ByteBuffer buffer)
AbstractStreamingHasher
chunk
bytes).process
in class AbstractStreamingHasher
protected void processRemaining(java.nio.ByteBuffer buffer)
AbstractStreamingHasher
ByteBuffer
is guaranteed to be non-empty.
This implementation simply pads with zeros and delegates to AbstractStreamingHasher.process(ByteBuffer)
.
processRemaining
in class AbstractStreamingHasher
protected HashCode makeHash()
AbstractStreamingHasher
AbstractStreamingHasher.process(java.nio.ByteBuffer)
and any leftover bytes that did not make a
complete chunk are handled with AbstractStreamingHasher.processRemaining(java.nio.ByteBuffer)
.makeHash
in class AbstractStreamingHasher
private void processM(long m)
private void sipRound(int iterations)