Package | Description |
---|---|
com.google.common.hash |
Hash functions and related structures.
|
com.google.common.io |
This package contains utility methods and classes for working with Java I/O; for example input
streams, output streams, readers, writers, and files.
|
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractCompositeHashFunction
An abstract composition of multiple hash functions.
|
(package private) class |
AbstractNonStreamingHashFunction
Skeleton implementation of
HashFunction , appropriate for non-streaming algorithms. |
(package private) class |
AbstractStreamingHashFunction
Skeleton implementation of
HashFunction . |
(package private) class |
ChecksumHashFunction
HashFunction adapter for Checksum instances. |
(package private) class |
Crc32cHashFunction
This class generates a CRC32C checksum, defined by RFC 3720, Section 12.1.
|
(package private) class |
FarmHashFingerprint64
Implementation of FarmHash Fingerprint64, an open-source fingerprinting algorithm for strings.
|
private static class |
Hashing.ConcatenatedHashFunction |
(package private) class |
MacHashFunction
HashFunction adapter for Mac instances. |
(package private) class |
MessageDigestHashFunction
HashFunction adapter for MessageDigest instances. |
(package private) class |
Murmur3_128HashFunction
See MurmurHash3_x64_128 in the
C++ implementation.
|
(package private) class |
Murmur3_32HashFunction
See MurmurHash3_x86_32 in the
C++ implementation.
|
(package private) class |
SipHashFunction
HashFunction implementation of SipHash-c-d. |
Modifier and Type | Field and Description |
---|---|
(package private) static HashFunction |
Hashing.Adler32Holder.ADLER_32 |
(package private) static HashFunction |
Hashing.Crc32Holder.CRC_32 |
(package private) static HashFunction |
Hashing.Crc32cHolder.CRC_32_C |
(package private) static HashFunction |
Hashing.FarmHashFingerprint64Holder.FARMHASH_FINGERPRINT_64 |
(package private) HashFunction[] |
AbstractCompositeHashFunction.functions |
(package private) static HashFunction |
Hashing.Murmur3_128Holder.GOOD_FAST_HASH_FUNCTION_128
Returned by
Hashing.goodFastHash(int) when 32 < minimumBits <= 128 . |
(package private) static HashFunction |
Hashing.Murmur3_32Holder.GOOD_FAST_HASH_FUNCTION_32
Returned by
Hashing.goodFastHash(int) when minimumBits <= 32 . |
(package private) static HashFunction |
Hashing.Md5Holder.MD5 |
(package private) static HashFunction |
Hashing.Murmur3_128Holder.MURMUR3_128 |
(package private) static HashFunction |
Hashing.Murmur3_32Holder.MURMUR3_32 |
(package private) static HashFunction |
Hashing.Sha1Holder.SHA_1 |
(package private) static HashFunction |
Hashing.Sha256Holder.SHA_256 |
(package private) static HashFunction |
Hashing.Sha384Holder.SHA_384 |
(package private) static HashFunction |
Hashing.Sha512Holder.SHA_512 |
(package private) static HashFunction |
Hashing.SipHash24Holder.SIP_HASH_24 |
Modifier and Type | Method and Description |
---|---|
static HashFunction |
Hashing.adler32()
Returns a hash function implementing the Adler-32 checksum algorithm (32 hash bits) by
delegating to the
Adler32 Checksum . |
private static HashFunction |
Hashing.checksumHashFunction(Hashing.ChecksumType type,
java.lang.String toString) |
static HashFunction |
Hashing.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.
|
static HashFunction |
Hashing.concatenating(java.lang.Iterable<HashFunction> hashFunctions)
Returns a hash function which computes its hash code by concatenating the hash codes of the
underlying hash functions together.
|
static HashFunction |
Hashing.crc32()
Returns a hash function implementing the CRC-32 checksum algorithm (32 hash bits) by delegating
to the
CRC32 Checksum . |
static HashFunction |
Hashing.crc32c()
Returns a hash function implementing the CRC32C checksum algorithm (32 hash bits) as described
by RFC 3720, Section 12.1.
|
static HashFunction |
Hashing.farmHashFingerprint64()
Returns a hash function implementing FarmHash's Fingerprint64, an open-source algorithm.
|
static HashFunction |
Hashing.goodFastHash(int minimumBits)
Returns a general-purpose, temporary-use, non-cryptographic hash function.
|
static HashFunction |
Hashing.hmacMd5(byte[] key)
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
MD5 (128 hash bits) hash function and a
SecretSpecKey created from the given byte array
and the MD5 algorithm. |
static HashFunction |
Hashing.hmacMd5(java.security.Key key)
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
MD5 (128 hash bits) hash function and the given secret key.
|
static HashFunction |
Hashing.hmacSha1(byte[] key)
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-1 (160 hash bits) hash function and a
SecretSpecKey created from the given byte
array and the SHA-1 algorithm. |
static HashFunction |
Hashing.hmacSha1(java.security.Key key)
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-1 (160 hash bits) hash function and the given secret key.
|
static HashFunction |
Hashing.hmacSha256(byte[] key)
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-256 (256 hash bits) hash function and a
SecretSpecKey created from the given byte
array and the SHA-256 algorithm. |
static HashFunction |
Hashing.hmacSha256(java.security.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.
|
static HashFunction |
Hashing.hmacSha512(byte[] key)
Returns a hash function implementing the Message Authentication Code (MAC) algorithm, using the
SHA-512 (512 hash bits) hash function and a
SecretSpecKey created from the given byte
array and the SHA-512 algorithm. |
static HashFunction |
Hashing.hmacSha512(java.security.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.
|
static HashFunction |
Hashing.md5()
Returns a hash function implementing the MD5 hash algorithm (128 hash bits) by delegating to
the MD5
MessageDigest . |
static HashFunction |
Hashing.murmur3_128()
Returns a hash function implementing the
128-bit murmur3 algorithm,
x64 variant (little-endian variant), using a seed value of zero.
|
static HashFunction |
Hashing.murmur3_128(int seed)
Returns a hash function implementing the
128-bit murmur3 algorithm,
x64 variant (little-endian variant), using the given seed value.
|
static HashFunction |
Hashing.murmur3_32()
Returns a hash function implementing the
32-bit murmur3 algorithm,
x86 variant (little-endian variant), using a seed value of zero.
|
static HashFunction |
Hashing.murmur3_32(int seed)
Returns a hash function implementing the
32-bit murmur3 algorithm,
x86 variant (little-endian variant), using the given seed value.
|
static HashFunction |
Hashing.sha1()
Returns a hash function implementing the SHA-1 algorithm (160 hash bits) by delegating to the
SHA-1
MessageDigest . |
static HashFunction |
Hashing.sha256()
Returns a hash function implementing the SHA-256 algorithm (256 hash bits) by delegating to the
SHA-256
MessageDigest . |
static HashFunction |
Hashing.sha384()
Returns a hash function implementing the SHA-384 algorithm (384 hash bits) by delegating to the
SHA-384
MessageDigest . |
static HashFunction |
Hashing.sha512()
Returns a hash function implementing the SHA-512 algorithm (512 hash bits) by delegating to the
SHA-512
MessageDigest . |
static HashFunction |
Hashing.sipHash24()
Returns a hash function implementing the 64-bit
SipHash-2-4 algorithm using a seed value of
k = 00 01 02 ... . |
static HashFunction |
Hashing.sipHash24(long k0,
long k1)
Returns a hash function implementing the 64-bit
SipHash-2-4 algorithm using the given seed.
|
Modifier and Type | Method and Description |
---|---|
static HashFunction |
Hashing.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.
|
static HashFunction |
Hashing.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.
|
Modifier and Type | Method and Description |
---|---|
static HashFunction |
Hashing.concatenating(java.lang.Iterable<HashFunction> hashFunctions)
Returns a hash function which computes its hash code by concatenating the hash codes of the
underlying hash functions together.
|
Constructor and Description |
---|
AbstractCompositeHashFunction(HashFunction... functions) |
ConcatenatedHashFunction(HashFunction... functions) |
HashingInputStream(HashFunction hashFunction,
java.io.InputStream in)
Creates an input stream that hashes using the given
HashFunction and delegates all data
read from it to the underlying InputStream . |
HashingOutputStream(HashFunction hashFunction,
java.io.OutputStream out)
Creates an output stream that hashes using the given
HashFunction , and forwards all
data written to it to the underlying OutputStream . |
Modifier and Type | Method and Description |
---|---|
static HashCode |
Files.hash(java.io.File file,
HashFunction hashFunction)
Computes the hash code of the
file using hashFunction . |
HashCode |
ByteSource.hash(HashFunction hashFunction)
Hashes the contents of this byte source using the given hash function.
|
HashCode |
ByteSource.ByteArrayByteSource.hash(HashFunction hashFunction) |