Package io.grpc.xds
Class XxHash64
- java.lang.Object
-
- io.grpc.xds.XxHash64
-
final class XxHash64 extends java.lang.ObjectThe XxHash is a fast, non-cryptographic, 64-bit hash function that has excellent avalanche and 2-way bit independence properties.This implementation is a simplified version adapted from OpenHFT/Zero-Allocation-Hashing.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classXxHash64.AsciiStringByteSupplierprivate static classXxHash64.ByteSupplierprivate static classXxHash64.PlainByteSupplier
-
Constructor Summary
Constructors Constructor Description XxHash64(long seed)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static longfinalize(long hash)(package private) longhashAsciiString(java.lang.String input)(package private) longhashByte(byte input)(package private) longhashBytes(byte[] bytes)(package private) longhashBytes(byte[] bytes, int offset, int len)private longhashBytes(XxHash64.ByteSupplier supplier)(package private) longhashChar(char input)(package private) longhashInt(int input)(package private) longhashLong(long input)(package private) longhashShort(short input)(package private) longhashVoid()
-
-
-
Field Detail
-
INSTANCE
static final XxHash64 INSTANCE
-
P1
private static final long P1
- See Also:
- Constant Field Values
-
P2
private static final long P2
- See Also:
- Constant Field Values
-
P3
private static final long P3
- See Also:
- Constant Field Values
-
P4
private static final long P4
- See Also:
- Constant Field Values
-
P5
private static final long P5
- See Also:
- Constant Field Values
-
byteOrder
private static final java.nio.ByteOrder byteOrder
-
seed
private final long seed
-
voidHash
private final long voidHash
-
-
Method Detail
-
hashLong
long hashLong(long input)
-
hashInt
long hashInt(int input)
-
hashShort
long hashShort(short input)
-
hashChar
long hashChar(char input)
-
hashByte
long hashByte(byte input)
-
hashVoid
long hashVoid()
-
hashAsciiString
long hashAsciiString(java.lang.String input)
-
hashBytes
long hashBytes(byte[] bytes)
-
hashBytes
long hashBytes(byte[] bytes, int offset, int len)
-
hashBytes
private long hashBytes(XxHash64.ByteSupplier supplier)
-
finalize
private static long finalize(long hash)
-
-