HashFunction instances, and other static hashing-related
utilities.
A comparison of the various hash functions can be found here.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static enum | |
| private static class | |
| private static class | |
| private static enum | |
| private static class | Hashing.LinearCongruentialGenerator
Linear CongruentialGenerator to use for consistent hashing. |
| private static class | |
| private static class | |
| private static class | |
| private static class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv static final int | GOOD_FAST_HASH_SEED
Used to randomize |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static HashFunction | |
| pack-priv static int | checkPositiveAndMakeMultipleOf32(int bits)
Checks that the passed argument is positive, and ceils it to a multiple of 32. |
| public static HashCode | combineOrdered(Iterable<HashCode> hashCodes)
Returns a hash code, having the same bit length as each of the input hash codes, that combines the information of these hash codes in an ordered fashion. |
| public static HashCode | combineUnordered(Iterable<HashCode> hashCodes)
Returns a hash code, having the same bit length as each of the input hash codes, that combines the information of these hash codes in an unordered fashion. |
| public static HashFunction | concatenating(HashFunction first, HashFunction second, HashFunction... rest)
Returns a hash function which computes its hash code by concatenating the hash codes of the underlying hash functions together. |
| public static HashFunction | concatenating(Iterable<HashFunction> hashFunctions)
Returns a hash function which computes its hash code by concatenating the hash codes of the underlying hash functions together. |
| public static int | consistentHash(HashCode hashCode, int buckets)
Assigns to |
| public static int | consistentHash(long input, int buckets)
Assigns to |
| public static HashFunction | |
| public static HashFunction | crc32c()
Returns a hash function implementing the CRC32C checksum algorithm (32 hash bits) as described by RFC 3720, Section 12.1. |
| public static HashFunction | farmHashFingerprint64()
Returns a hash function implementing FarmHash's Fingerprint64, an open-source algorithm. |
| public static HashFunction | fingerprint2011()
Returns a hash function implementing the Fingerprint2011 hashing function (64 hash bits). |
| public static HashFunction | Returns: a hash function, described above, that produces hash codes of lengthminimumBits or greatera positive integer. This can be arbitrarily large. The returned minimumBits)HashFunction instance may use memory proportional to this integer.Returns a general-purpose, temporary-use, non-cryptographic hash function. |
| public static HashFunction | |
| public static HashFunction | hmacMd5(byte[]
the key material of the secret key key)Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
MD5 (128 hash bits) hash function and a |
| public static HashFunction | |
| public static HashFunction | hmacSha1(byte[]
the key material of the secret key key)Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-1 (160 hash bits) hash function and a |
| public static HashFunction | hmacSha256(Key
the secret key key)Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the SHA-256 (256 hash bits) hash function and the given secret key. |
| public static HashFunction | hmacSha256(byte[]
the key material of the secret key key)Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-256 (256 hash bits) hash function and a |
| public static HashFunction | hmacSha512(Key
the secret key key)Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the SHA-512 (512 hash bits) hash function and the given secret key. |
| public static HashFunction | hmacSha512(byte[]
the key material of the secret key key)Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-512 (512 hash bits) hash function and a |
| private static String | |
| public static HashFunction | md5()
Deprecated
If you must interoperate with a system that requires MD5, then use this method,
despite its deprecation.
Returns a hash function implementing the MD5 hash algorithm (128 hash bits).
|
| public static HashFunction | murmur3_128(int seed)
Returns a hash function implementing the 128-bit murmur3 algorithm, x64 variant (little-endian variant), using the given seed value. |
| public static HashFunction | murmur3_128()
Returns a hash function implementing the 128-bit murmur3 algorithm, x64 variant (little-endian variant), using a seed value of zero. |
| public static HashFunction | murmur3_32(int seed)
Deprecated
This implementation produces incorrect hash values from the
Returns a hash function implementing the 32-bit murmur3
algorithm, x86 variant (little-endian variant), using the given seed value, with a known
bug as described in the deprecation text.
HashFunction#hashString method if the string contains non-BMP characters.
|
| public static HashFunction | murmur3_32()
Deprecated
This implementation produces incorrect hash values from the
Returns a hash function implementing the 32-bit murmur3
algorithm, x86 variant (little-endian variant), using the given seed value, with a known
bug as described in the deprecation text.
HashFunction#hashString method if the string contains non-BMP characters.
|
| public static HashFunction | murmur3_32_fixed(int seed)
Returns a hash function implementing the 32-bit murmur3 algorithm, x86 variant (little-endian variant), using the given seed value. |
| public static HashFunction | murmur3_32_fixed()
Returns a hash function implementing the 32-bit murmur3 algorithm, x86 variant (little-endian variant), using a seed value of zero. |
| public static HashFunction | sha1()
Deprecated
If you must interoperate with a system that requires SHA-1, then use this method,
despite its deprecation.
Returns a hash function implementing the SHA-1 algorithm (160 hash bits).
|
| public static HashFunction | |
| public static HashFunction | |
| public static HashFunction | |
| public static HashFunction | sipHash24()
Returns a hash function implementing the 64-bit
SipHash-2-4 algorithm using a seed value of |
| public static HashFunction | sipHash24(long k0, long k1)
Returns a hash function implementing the 64-bit SipHash-2-4 algorithm using the given seed. |