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 classprivate static classprivate static class -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static longfinalize(long hash) (package private) longhashAsciiString(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 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)
-