Package io.grpc.xds
Class XxHash64
java.lang.Object
io.grpc.xds.XxHash64
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 ClassesModifier and TypeClassDescriptionprivate static class
private static class
private static class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static long
finalize
(long hash) (package private) long
hashAsciiString
(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 Details
-
INSTANCE
-
P1
private static final long P1- See Also:
-
P2
private static final long P2- See Also:
-
P3
private static final long P3- See Also:
-
P4
private static final long P4- See Also:
-
P5
private static final long P5- See Also:
-
byteOrder
-
seed
private final long seed -
voidHash
private final long voidHash
-
-
Constructor Details
-
XxHash64
XxHash64(long seed)
-
-
Method Details
-
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
-
hashBytes
long hashBytes(byte[] bytes) -
hashBytes
long hashBytes(byte[] bytes, int offset, int len) -
hashBytes
-
finalize
private static long finalize(long hash)
-