public class XXHash32
extends java.lang.Object
implements java.util.zip.Checksum
Copied from Commons Compress 1.14 https://git-wip-us.apache.org/repos/asf?p=commons-compress.git;a=blob;f=src/main/java/org/apache/commons/compress/compressors/lz4/XXHash32.java;h=a406ffc197449be594d46f0d2712b2d4786a1e68;hb=HEAD
NotThreadSafe
| Modifier and Type | Field and Description |
|---|---|
private static int |
BUF_SIZE |
private byte[] |
buffer |
private byte[] |
oneByte |
private int |
pos |
private static int |
PRIME1 |
private static int |
PRIME2 |
private static int |
PRIME3 |
private static int |
PRIME4 |
private static int |
PRIME5 |
private static int |
ROTATE_BITS |
private int |
seed |
private int[] |
state |
private int |
totalLen |
| Constructor and Description |
|---|
XXHash32()
Creates an XXHash32 instance with a seed of 0.
|
XXHash32(int seed)
Creates an XXHash32 instance.
|
| Modifier and Type | Method and Description |
|---|---|
private static long |
fromLittleEndian(byte[] bytes,
int off,
int length)
Reads the given byte array as a little endian long.
|
private static int |
getInt(byte[] buffer,
int idx) |
long |
getValue() |
private void |
initializeState() |
private void |
process(byte[] b,
int offset) |
void |
reset() |
void |
update(byte[] b,
int off,
int len) |
void |
update(int b) |
private static final int BUF_SIZE
private static final int ROTATE_BITS
private static final int PRIME1
private static final int PRIME2
private static final int PRIME3
private static final int PRIME4
private static final int PRIME5
private final byte[] oneByte
private final int[] state
private final byte[] buffer
private final int seed
private int totalLen
private int pos
public XXHash32()
public XXHash32(int seed)
seed - the seed to usepublic void reset()
reset in interface java.util.zip.Checksumpublic void update(int b)
update in interface java.util.zip.Checksumpublic void update(byte[] b,
int off,
int len)
update in interface java.util.zip.Checksumpublic long getValue()
getValue in interface java.util.zip.Checksumprivate static int getInt(byte[] buffer,
int idx)
private void initializeState()
private void process(byte[] b,
int offset)
private static long fromLittleEndian(byte[] bytes,
int off,
int length)
bytes - the byte array to convertoff - the offset into the array that starts the valuelength - the number of bytes representing the valuejava.lang.IllegalArgumentException - if len is bigger than eight