Top Description Interfaces Annotations Classes Enums
[default module]

Package com.google.common.hash

Annotations
@CheckReturnValue
@ParametersAreNonnullByDefault
Imports
com.google.errorprone.annotations.CheckReturnValue, javax.annotation.ParametersAreNonnullByDefault

Hash functions and related structures.

See the Guava User Guide article on hashing.

Interface Summary

Modifier and TypeInterface and Description
public interface
Funnel<T extends @Nullable Object>

An object which can send data from an object of type T into a PrimitiveSink.

public interface
Hasher

A PrimitiveSink that can compute a hash code after reading the input.

public interface
HashFunction

A hash function is a collision-averse pure function that maps an arbitrary block of data to a number called a hash code.

pack-priv interface
ImmutableSupplier<T>

Explicitly named subinterface of Supplier that can be marked @Immutable.

pack-priv interface
LongAddable

Abstract interface for objects that can concurrently add longs.

public interface
PrimitiveSink

An object which can receive a stream of primitive values.

Annotation Summary

Modifier and TypeAnnotation and Description
pack-priv @interface
ElementTypesAreNonnullByDefault

Marks all "top-level" types as non-null in a way that is recognized by Kotlin.

pack-priv @interface
IgnoreJRERequirement

Disables Animal Sniffer's checking of compatibility with older versions of Java/Android.

pack-priv @interface
ParametricNullness

Annotates a "top-level" type-variable usage that takes its nullness from the type argument supplied by the user of the class.

Class Summary

Modifier and TypeClass and Description
pack-priv abstract class
AbstractByteHasher

Abstract Hasher that handles converting primitives to bytes using a scratch ByteBuffer and streams all bytes to a sink to compute the hash.

pack-priv abstract class
AbstractCompositeHashFunction

An abstract composition of multiple hash functions.

pack-priv abstract class
AbstractHasher

An abstract implementation of Hasher, which only requires subtypes to implement putByte.

pack-priv abstract class
AbstractHashFunction

Skeleton implementation of HashFunction in terms of newHasher().

pack-priv abstract class
AbstractNonStreamingHashFunction

Skeleton implementation of HashFunction, appropriate for non-streaming algorithms.

pack-priv abstract class
AbstractStreamingHasher

A convenience base class for implementors of Hasher; handles accumulating data until an entire "chunk" (of implementation-dependent length) is ready to be hashed.

public class
BloomFilter<
the type of instances that the BloomFilter accepts
T extends @Nullable Object
>

A Bloom filter for instances of T.

pack-priv class
pack-priv class
Crc32cHashFunction

This class generates a CRC32C checksum, defined by RFC 3720, Section 12.1.

pack-priv class
FarmHashFingerprint64

Implementation of FarmHash Fingerprint64, an open-source fingerprinting algorithm for strings.

pack-priv class
Fingerprint2011

Implementation of Geoff Pike's fingerprint2011 hash function.

public class
Funnels

Funnels for common types.

public abstract class
HashCode

An immutable hash code of arbitrary bit length.

public class
Hashing

Static methods to obtain HashFunction instances, and other static hashing-related utilities.

public class
HashingInputStream

An InputStream that maintains a hash of the data read from it.

public class
HashingOutputStream

An OutputStream that maintains a hash of the data written to it.

pack-priv class
Java8Compatibility

Wrappers around Buffer methods that are covariantly overridden in Java 9+.

pack-priv class
LittleEndianByteArray

Utility functions for loading and storing values from a byte array.

pack-priv class
LongAddables

Source of LongAddable objects that deals with GWT, Unsafe, and all that.

pack-priv class
LongAdder

One or more variables that together maintain an initially zero long sum.

pack-priv class
MacHashFunction

HashFunction adapter for Mac instances.

pack-priv class
pack-priv class
pack-priv class
pack-priv class
SipHashFunction

HashFunction implementation of SipHash-c-d.

pack-priv abstract class
Striped64

A package-local class holding common representation and mechanics for classes supporting dynamic striping on 64bit values.

Enum Summary

Modifier and TypeEnum and Description
pack-priv enum
BloomFilterStrategies

Collections of strategies of generating the k * log(M) bits required for an element to be mapped to a BloomFilter of M bits and k hash functions.