Uses of Class
com.google.common.hash.HashCode
Package
Description
Hash functions and related structures.
Utility methods and classes for I/O; for example input streams, output streams, readers, writers,
and files.
-
Uses of HashCode in com.google.common.hash
Modifier and TypeMethodDescriptionstatic HashCode
Hashing.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.static HashCode
Hashing.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.static HashCode
HashCode.fromBytes
(byte[] bytes) Creates aHashCode
from a byte array.static HashCode
HashCode.fromInt
(int hash) Creates a 32-bitHashCode
representation of the given int value.static HashCode
HashCode.fromLong
(long hash) Creates a 64-bitHashCode
representation of the given long value.static HashCode
HashCode.fromString
(String string) Creates aHashCode
from a hexadecimal (base 16
) encoded string.Hasher.hash()
Computes a hash code based on the data that have been provided to this hasher.HashingInputStream.hash()
Returns theHashCode
based on the data read from this stream.HashingOutputStream.hash()
Returns theHashCode
based on the data written to this stream.HashFunction.hashBytes
(byte[] input) Shortcut fornewHasher().putBytes(input).hash()
.HashFunction.hashBytes
(byte[] input, int off, int len) Shortcut fornewHasher().putBytes(input, off, len).hash()
.HashFunction.hashBytes
(ByteBuffer input) Shortcut fornewHasher().putBytes(input).hash()
.HashFunction.hashInt
(int input) Shortcut fornewHasher().putInt(input).hash()
; returns the hash code for the givenint
value, interpreted in little-endian byte order.HashFunction.hashLong
(long input) Shortcut fornewHasher().putLong(input).hash()
; returns the hash code for the givenlong
value, interpreted in little-endian byte order.HashFunction.hashObject
(T instance, Funnel<? super T> funnel) Shortcut fornewHasher().putObject(instance, funnel).hash()
.HashFunction.hashString
(CharSequence input, Charset charset) Shortcut fornewHasher().putString(input, charset).hash()
.HashFunction.hashUnencodedChars
(CharSequence input) Shortcut fornewHasher().putUnencodedChars(input).hash()
.Modifier and TypeMethodDescriptionstatic int
Hashing.consistentHash
(HashCode hashCode, int buckets) Assigns tohashCode
a "bucket" in the range[0, buckets)
, in a uniform manner that minimizes the need for remapping asbuckets
grows.Modifier and TypeMethodDescriptionstatic HashCode
Hashing.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.static HashCode
Hashing.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. -
Uses of HashCode in com.google.common.io
Modifier and TypeMethodDescriptionByteSource.hash
(HashFunction hashFunction) Hashes the contents of this byte source using the given hash function.static HashCode
Files.hash
(File file, HashFunction hashFunction) Deprecated.
asByteSource(file).hash(hashFunction)
.