public final class HighwayHash extends Object
| Constructor and Description |
|---|
HighwayHash(long[] key) |
HighwayHash(long key0,
long key1,
long key2,
long key3) |
| Modifier and Type | Method and Description |
|---|---|
long[] |
finalize128()
Computes the hash value after all bytes were processed.
|
long[] |
finalize256()
Computes the hash value after all bytes were processed.
|
long |
finalize64()
Computes the hash value after all bytes were processed.
|
static long[] |
hash128(byte[] data,
int offset,
int length,
long[] key)
NOTE: The 128-bit HighwayHash algorithm is not yet frozen and subject to change.
|
static long[] |
hash256(byte[] data,
int offset,
int length,
long[] key)
NOTE: The 256-bit HighwayHash algorithm is not yet frozen and subject to change.
|
static long |
hash64(byte[] data,
int offset,
int length,
long[] key)
NOTE: The 64-bit HighwayHash algorithm is declared stable and no longer subject to change.
|
void |
update(long a0,
long a1,
long a2,
long a3)
Updates the hash with 32 bytes of data given as 4 longs.
|
void |
updatePacket(byte[] packet,
int pos)
Updates the hash with 32 bytes of data.
|
void |
updateRemainder(byte[] bytes,
int pos,
int size_mod32)
Updates the hash with the last 1 to 31 bytes of the data.
|
public HighwayHash(long key0,
long key1,
long key2,
long key3)
key0 - first 8 bytes of the keykey1 - next 8 bytes of the keykey2 - next 8 bytes of the keykey3 - last 8 bytes of the keypublic HighwayHash(long[] key)
key - array of size 4 with the key to initialize the hash withpublic void updatePacket(byte[] packet,
int pos)
packet - data array which has a length of at least pos + 32pos - position in the array to read the first of 32 bytes frompublic void update(long a0,
long a1,
long a2,
long a3)
a0 - first 8 bytes in little endian 64-bit longa1 - next 8 bytes in little endian 64-bit longa2 - next 8 bytes in little endian 64-bit longa3 - last 8 bytes in little endian 64-bit longpublic void updateRemainder(byte[] bytes,
int pos,
int size_mod32)
bytes - data array which has a length of at least pos + size_mod32pos - position in the array to start reading size_mod32 bytes fromsize_mod32 - the amount of bytes to readpublic long finalize64()
public long[] finalize128()
public long[] finalize256()
public static long hash64(byte[] data,
int offset,
int length,
long[] key)
data - array with data bytesoffset - position of first byte of data to read fromlength - number of bytes from data to readkey - array of size 4 with the key to initialize the hash withpublic static long[] hash128(byte[] data,
int offset,
int length,
long[] key)
data - array with data bytesoffset - position of first byte of data to read fromlength - number of bytes from data to readkey - array of size 4 with the key to initialize the hash withpublic static long[] hash256(byte[] data,
int offset,
int length,
long[] key)
data - array with data bytesoffset - position of first byte of data to read fromlength - number of bytes from data to readkey - array of size 4 with the key to initialize the hash withCopyright © 2014–2018 The Redisson Project. All rights reserved.