Package net.jpountz.xxhash
Class XXHash32
java.lang.Object
net.jpountz.xxhash.XXHash32
A 32-bits hash.
Instances of this class are thread-safe.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract inthash(byte[] buf, int off, int len, int seed) Computes the 32-bits hash ofbuf[off:off+len]using seedseed.final inthash(ByteBuffer buf, int seed) Computes the hash of the givenByteBuffer.abstract inthash(ByteBuffer buf, int off, int len, int seed) Computes the hash of the given slice of theByteBuffer.toString()
-
Constructor Details
-
XXHash32
public XXHash32()
-
-
Method Details
-
hash
public abstract int hash(byte[] buf, int off, int len, int seed) Computes the 32-bits hash ofbuf[off:off+len]using seedseed.- Parameters:
buf- the input dataoff- the start offset in buflen- the number of bytes to hashseed- the seed to use- Returns:
- the hash value
-
hash
- Parameters:
buf- the input dataoff- the start offset in buflen- the number of bytes to hashseed- the seed to use- Returns:
- the hash value
-
hash
Computes the hash of the givenByteBuffer. Thepositionis moved in order to reflect bytes which have been read.- Parameters:
buf- the input dataseed- the seed to use- Returns:
- the hash value
-
toString
-