Package net.jpountz.xxhash
Class XXHash32
- java.lang.Object
-
- net.jpountz.xxhash.XXHash32
-
public abstract class XXHash32 extends java.lang.Object
A 32-bits hash.Instances of this class are thread-safe.
-
-
Constructor Summary
Constructors Constructor Description XXHash32()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract int
hash(byte[] buf, int off, int len, int seed)
Computes the 32-bits hash ofbuf[off:off+len]
using seedseed
.int
hash(java.nio.ByteBuffer buf, int seed)
Computes the hash of the givenByteBuffer
.abstract int
hash(java.nio.ByteBuffer buf, int off, int len, int seed)
Computes the hash of the given slice of theByteBuffer
.java.lang.String
toString()
-
-
-
Method Detail
-
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
public abstract int hash(java.nio.ByteBuffer buf, int off, int len, int seed)
Computes the hash of the given slice of theByteBuffer
.position
andlimit
are not modified.- 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
public final int hash(java.nio.ByteBuffer buf, int seed)
Computes the hash of the givenByteBuffer
. Theposition
is moved in order to reflect bytes which have been read.- Parameters:
buf
- the input dataseed
- the seed to use- Returns:
- the hash value
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-