@ParametersAreNonnullByDefault
Package com.google.common.hash
Hash functions and related structures.
See the Guava User Guide article on hashing.
-
Interface Summary Interface Description BloomFilter.Strategy A strategy to translate T instances, tonumHashFunctionsbit indexes.Funnel<T> An object which can send data from an object of typeTinto aPrimitiveSink.Hasher APrimitiveSinkthat can compute a hash code after reading the input.HashFunction A hash function is a collision-averse pure function that maps an arbitrary block of data to a number called a hash code.ImmutableSupplier<T> Explicitly named subinterface ofSupplierthat can be marked @Immutable.LittleEndianByteArray.LittleEndianBytes Common interface for retrieving a 64-bit long from a little-endian byte array.LongAddable Abstract interface for objects that can concurrently add longs.PrimitiveSink An object which can receive a stream of primitive values. -
Class Summary Class Description AbstractByteHasher AbstractHasherthat handles converting primitives to bytes using a scratchByteBufferand streams all bytes to a sink to compute the hash.AbstractCompositeHashFunction An abstract composition of multiple hash functions.AbstractHasher An abstract implementation ofHasher, which only requires subtypes to implementHasher.putByte(byte).AbstractHashFunction Skeleton implementation ofHashFunctionin terms ofHashFunction.newHasher().AbstractNonStreamingHashFunction Skeleton implementation ofHashFunction, appropriate for non-streaming algorithms.AbstractNonStreamingHashFunction.ExposedByteArrayOutputStream AbstractStreamingHasher A convenience base class for implementors ofHasher; handles accumulating data until an entire "chunk" (of implementation-dependent length) is ready to be hashed.BloomFilter<T> A Bloom filter for instances ofT.BloomFilter.SerialForm<T> BloomFilterStrategies.LockFreeBitArray Models a lock-free array of bits.ChecksumHashFunction HashFunctionadapter forChecksuminstances.Crc32cHashFunction This class generates a CRC32C checksum, defined by RFC 3720, Section 12.1.Crc32cHashFunction.Crc32cHasher FarmHashFingerprint64 Implementation of FarmHash Fingerprint64, an open-source fingerprinting algorithm for strings.Funnels Funnels for common types.Funnels.SequentialFunnel<E> Funnels.SinkAsStream Funnels.StringCharsetFunnel Funnels.StringCharsetFunnel.SerializedForm HashCode An immutable hash code of arbitrary bit length.HashCode.BytesHashCode HashCode.IntHashCode HashCode.LongHashCode Hashing Static methods to obtainHashFunctioninstances, and other static hashing-related utilities.Hashing.ConcatenatedHashFunction Hashing.LinearCongruentialGenerator Linear CongruentialGenerator to use for consistent hashing.Hashing.Md5Holder Hashing.Sha1Holder Hashing.Sha256Holder Hashing.Sha384Holder Hashing.Sha512Holder HashingInputStream AnInputStreamthat maintains a hash of the data read from it.HashingOutputStream AnOutputStreamthat maintains a hash of the data written to it.LittleEndianByteArray Utility functions for loading and storing values from a byte array.LongAddables Source ofLongAddableobjects that deals with GWT, Unsafe, and all that.LongAddables.PureJavaLongAddable LongAdder One or more variables that together maintain an initially zerolongsum.MacHashFunction HashFunctionadapter forMacinstances.MacHashFunction.MacHasher Hasher that updates aMac(message authentication code).MessageDigestHashFunction HashFunctionadapter forMessageDigestinstances.MessageDigestHashFunction.MessageDigestHasher Hasher that updates a message digest.MessageDigestHashFunction.SerializedForm Murmur3_128HashFunction See MurmurHash3_x64_128 in the C++ implementation.Murmur3_128HashFunction.Murmur3_128Hasher Murmur3_32HashFunction See MurmurHash3_x86_32 in the C++ implementation.Murmur3_32HashFunction.Murmur3_32Hasher SipHashFunction HashFunctionimplementation of SipHash-c-d.SipHashFunction.SipHasher Striped64 A package-local class holding common representation and mechanics for classes supporting dynamic striping on 64bit values.Striped64.Cell Padded variant of AtomicLong supporting only raw accesses plus CAS. -
Enum Summary Enum Description 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.Funnels.ByteArrayFunnel Funnels.IntegerFunnel Funnels.LongFunnel Funnels.UnencodedCharsFunnel Hashing.ChecksumType LittleEndianByteArray.JavaLittleEndianBytes Fallback implementation for when Unsafe is not available in our current environment.LittleEndianByteArray.UnsafeByteArray The only reference to Unsafe is in this nested class.