static final class Crc32cHashFunction.Crc32cHasher extends AbstractStreamingHasher
Modifier and Type | Field and Description |
---|---|
(package private) static int[] |
BYTE_TABLE |
private int |
crc0 |
private int |
crc1 |
private int |
crc2 |
private int |
crc3 |
private static java.nio.ByteBuffer |
EMPTY |
private boolean |
finished |
(package private) static int |
INVERSE_COMPUTE_FOR_WORD_OF_ALL_1S |
(package private) static int[][] |
STRIDE_TABLE |
Constructor and Description |
---|
Crc32cHasher() |
Modifier and Type | Method and Description |
---|---|
(package private) static int |
combine(int csum,
int crc) |
(package private) static int |
computeForWord(int word) |
protected HashCode |
makeHash()
Computes a hash code based on the data that have been provided to this hasher.
|
protected void |
process(java.nio.ByteBuffer bb)
Processes the available bytes of the buffer (at most
chunk 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.
|
hash, putByte, putBytes, putBytes, putChar, putInt, putLong, putShort
putBoolean, putBytes, putDouble, putFloat, putObject, putString, putUnencodedChars
private boolean finished
private int crc0
private int crc1
private int crc2
private int crc3
static final int[] BYTE_TABLE
static final int[][] STRIDE_TABLE
static final int INVERSE_COMPUTE_FOR_WORD_OF_ALL_1S
private static final java.nio.ByteBuffer EMPTY
protected void process(java.nio.ByteBuffer bb)
AbstractStreamingHasher
chunk
bytes).process
in class AbstractStreamingHasher
protected void processRemaining(java.nio.ByteBuffer bb)
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
static int computeForWord(int word)
static int combine(int csum, int crc)