Package io.grpc.xds
Class XxHash64
- java.lang.Object
-
- io.grpc.xds.XxHash64
-
final class XxHash64 extends java.lang.Object
The 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 class
XxHash64.AsciiStringByteSupplier
private static class
XxHash64.ByteSupplier
private static class
XxHash64.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 long
finalize(long hash)
(package private) long
hashAsciiString(java.lang.String input)
(package private) long
hashByte(byte input)
(package private) long
hashBytes(byte[] bytes)
(package private) long
hashBytes(byte[] bytes, int offset, int len)
private long
hashBytes(XxHash64.ByteSupplier supplier)
(package private) long
hashChar(char input)
(package private) long
hashInt(int input)
(package private) long
hashLong(long input)
(package private) long
hashShort(short input)
(package private) long
hashVoid()
-
-
-
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)
-
-