public abstract class StreamingXXHash32 extends Object
XXHash32
.
This API is compatible with the block API
and the following
code samples are equivalent:
int hash(XXHashFactory xxhashFactory, byte[] buf, int off, int len, int seed) { return xxhashFactory.hash32().hash(buf, off, len, seed); }
int hash(XXHashFactory xxhashFactory, byte[] buf, int off, int len, int seed) { StreamingXXHash32 sh32 = xxhashFactory.newStreamingHash32(seed); sh32.update(buf, off, len); return sh32.getValue(); }
Instances of this class are not thread-safe.
Modifier and Type | Method and Description |
---|---|
Checksum |
asChecksum()
Returns a
Checksum view of this instance. |
abstract int |
getValue()
Returns the value of the checksum.
|
abstract void |
reset()
Resets this instance to the state it had right after instantiation.
|
String |
toString() |
abstract void |
update(byte[] buf,
int off,
int len)
Updates the value of the hash with buf[off:off+len].
|
public abstract int getValue()
public abstract void update(byte[] buf, int off, int len)
buf
- the input dataoff
- the start offset in buflen
- the number of bytes to hashpublic abstract void reset()