Package com.google.common.hash
Class ChecksumHashFunction
java.lang.Object
com.google.common.hash.AbstractHashFunction
com.google.common.hash.ChecksumHashFunction
- All Implemented Interfaces:
HashFunction,Serializable
HashFunction adapter for Checksum instances.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate final classHasher that updates a checksum.private static final class -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final intprivate final ImmutableSupplier<? extends Checksum> private static final longprivate final String -
Constructor Summary
ConstructorsConstructorDescriptionChecksumHashFunction(ImmutableSupplier<? extends Checksum> checksumSupplier, int bits, String toString) -
Method Summary
Methods inherited from class com.google.common.hash.AbstractHashFunction
hashBytes, hashBytes, hashBytes, hashInt, hashLong, hashObject, hashString, hashUnencodedChars, newHasher
-
Field Details
-
checksumSupplier
-
bits
private final int bits -
toString
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
ChecksumHashFunction
ChecksumHashFunction(ImmutableSupplier<? extends Checksum> checksumSupplier, int bits, String toString)
-
-
Method Details
-
bits
public int bits()Description copied from interface:HashFunctionReturns the number of bits (a multiple of 32) that each hash code produced by this hash function has.- Specified by:
bitsin interfaceHashFunction
-
newHasher
Description copied from interface:HashFunctionBegins a new hash code computation by returning an initialized, statefulHasherinstance that is ready to receive data. Example:HashFunction hf = Hashing.md5(); HashCode hc = hf.newHasher() .putLong(id) .putBoolean(isActive) .hash();- Specified by:
newHasherin interfaceHashFunction
-
toString
-