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 |
---|---|
private static class |
HashCode.BytesHashCode |
private static class |
HashCode.IntHashCode |
private static class |
HashCode.LongHashCode |
Modifier and Type | Method and Description |
---|---|
static HashCode |
Hashing.combineOrdered(java.lang.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.
|
static HashCode |
Hashing.combineUnordered(java.lang.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.
|
private static HashCode |
Murmur3_32HashFunction.fmix(int h1,
int length) |
static HashCode |
HashCode.fromBytes(byte[] bytes)
Creates a
HashCode from a byte array. |
(package private) static HashCode |
HashCode.fromBytesNoCopy(byte[] bytes)
Creates a
HashCode from a byte array. |
static HashCode |
HashCode.fromInt(int hash)
Creates a 32-bit
HashCode representation of the given int value. |
static HashCode |
HashCode.fromLong(long hash)
Creates a 64-bit
HashCode representation of the given long value. |
static HashCode |
HashCode.fromString(java.lang.String string)
Creates a
HashCode from a hexadecimal (base 16 ) encoded string. |
HashCode |
MacHashFunction.MacHasher.hash() |
HashCode |
MessageDigestHashFunction.MessageDigestHasher.hash() |
HashCode |
HashingInputStream.hash()
Returns the
HashCode based on the data read from this stream. |
HashCode |
HashingOutputStream.hash()
Returns the
HashCode based on the data written to this stream. |
HashCode |
Murmur3_32HashFunction.Murmur3_32Hasher.hash() |
HashCode |
ChecksumHashFunction.ChecksumHasher.hash() |
HashCode |
AbstractNonStreamingHashFunction.BufferingHasher.hash() |
HashCode |
AbstractStreamingHasher.hash() |
HashCode |
Hasher.hash()
Computes a hash code based on the data that have been provided to this hasher.
|
HashCode |
AbstractHashFunction.hashBytes(byte[] input) |
HashCode |
HashFunction.hashBytes(byte[] input)
Shortcut for
newHasher().putBytes(input).hash() . |
HashCode |
Fingerprint2011.hashBytes(byte[] input,
int off,
int len) |
HashCode |
AbstractHashFunction.hashBytes(byte[] input,
int off,
int len) |
HashCode |
HashFunction.hashBytes(byte[] input,
int off,
int len)
Shortcut for
newHasher().putBytes(input, off, len).hash() . |
HashCode |
Murmur3_32HashFunction.hashBytes(byte[] input,
int off,
int len) |
HashCode |
FarmHashFingerprint64.hashBytes(byte[] input,
int off,
int len) |
abstract HashCode |
AbstractNonStreamingHashFunction.hashBytes(byte[] input,
int off,
int len) |
HashCode |
AbstractHashFunction.hashBytes(java.nio.ByteBuffer input) |
HashCode |
HashFunction.hashBytes(java.nio.ByteBuffer input)
Shortcut for
newHasher().putBytes(input).hash() . |
HashCode |
AbstractNonStreamingHashFunction.hashBytes(java.nio.ByteBuffer input) |
HashCode |
AbstractHashFunction.hashInt(int input) |
HashCode |
HashFunction.hashInt(int input)
Shortcut for
newHasher().putInt(input).hash() ; returns the hash code for the given
int value, interpreted in little-endian byte order. |
HashCode |
Murmur3_32HashFunction.hashInt(int input) |
HashCode |
AbstractNonStreamingHashFunction.hashInt(int input) |
HashCode |
AbstractHashFunction.hashLong(long input) |
HashCode |
HashFunction.hashLong(long input)
Shortcut for
newHasher().putLong(input).hash() ; returns the hash code for the given
long value, interpreted in little-endian byte order. |
HashCode |
Murmur3_32HashFunction.hashLong(long input) |
HashCode |
AbstractNonStreamingHashFunction.hashLong(long input) |
<T> HashCode |
AbstractHashFunction.hashObject(T instance,
Funnel<? super T> funnel) |
<T> HashCode |
HashFunction.hashObject(T instance,
Funnel<? super T> funnel)
Shortcut for
newHasher().putObject(instance, funnel).hash() . |
HashCode |
AbstractHashFunction.hashString(java.lang.CharSequence input,
java.nio.charset.Charset charset) |
HashCode |
HashFunction.hashString(java.lang.CharSequence input,
java.nio.charset.Charset charset)
Shortcut for
newHasher().putString(input, charset).hash() . |
HashCode |
Murmur3_32HashFunction.hashString(java.lang.CharSequence input,
java.nio.charset.Charset charset) |
HashCode |
AbstractNonStreamingHashFunction.hashString(java.lang.CharSequence input,
java.nio.charset.Charset charset) |
HashCode |
AbstractHashFunction.hashUnencodedChars(java.lang.CharSequence input) |
HashCode |
HashFunction.hashUnencodedChars(java.lang.CharSequence input)
Shortcut for
newHasher().putUnencodedChars(input).hash() . |
HashCode |
Murmur3_32HashFunction.hashUnencodedChars(java.lang.CharSequence input) |
HashCode |
AbstractNonStreamingHashFunction.hashUnencodedChars(java.lang.CharSequence input) |
protected HashCode |
Crc32cHashFunction.Crc32cHasher.makeHash() |
protected HashCode |
SipHashFunction.SipHasher.makeHash() |
protected HashCode |
Murmur3_128HashFunction.Murmur3_128Hasher.makeHash() |
protected abstract HashCode |
AbstractStreamingHasher.makeHash()
Computes a hash code based on the data that have been provided to this hasher.
|
(package private) HashCode |
Hashing.ConcatenatedHashFunction.makeHash(Hasher[] hashers) |
(package private) abstract HashCode |
AbstractCompositeHashFunction.makeHash(Hasher[] hashers)
Constructs a
HashCode from the Hasher objects of the functions. |
Modifier and Type | Method and Description |
---|---|
static int |
Hashing.consistentHash(HashCode hashCode,
int buckets)
Assigns to
hashCode a "bucket" in the range [0, buckets) , in a uniform manner
that minimizes the need for remapping as buckets grows. |
(package private) abstract boolean |
HashCode.equalsSameBits(HashCode that)
Returns whether this
HashCode and that HashCode have the same value, given that
they have the same number of bits. |
(package private) boolean |
HashCode.IntHashCode.equalsSameBits(HashCode that) |
(package private) boolean |
HashCode.LongHashCode.equalsSameBits(HashCode that) |
(package private) boolean |
HashCode.BytesHashCode.equalsSameBits(HashCode that) |
Modifier and Type | Method and Description |
---|---|
static HashCode |
Hashing.combineOrdered(java.lang.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.
|
static HashCode |
Hashing.combineUnordered(java.lang.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.
|
Modifier and Type | Method and Description |
---|---|
static HashCode |
Files.hash(java.io.File file,
HashFunction hashFunction)
Deprecated.
Prefer
asByteSource(file).hash(hashFunction) . |
HashCode |
ByteSource.hash(HashFunction hashFunction)
Hashes the contents of this byte source using the given hash function.
|
HashCode |
ByteSource.ByteArrayByteSource.hash(HashFunction hashFunction) |