Package com.google.common.hash
Class MacHashFunction.MacHasher
java.lang.Object
com.google.common.hash.AbstractHasher
com.google.common.hash.AbstractByteHasher
com.google.common.hash.MacHashFunction.MacHasher
- All Implemented Interfaces:
Hasher
,PrimitiveSink
- Enclosing class:
MacHashFunction
Hasher that updates a
Mac
(message authentication code).-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
hash()
Computes a hash code based on the data that have been provided to this hasher.protected void
update
(byte b) Updates this hasher with the given byte.protected void
update
(byte[] b) Updates this hasher with the given bytes.protected void
update
(byte[] b, int off, int len) Updates this hasher withlen
bytes starting atoff
in the given buffer.protected void
update
(ByteBuffer bytes) Updates this hasher with bytes from the given buffer.Methods inherited from class com.google.common.hash.AbstractByteHasher
putByte, putBytes, putBytes, putBytes, putChar, putInt, putLong, putShort
Methods inherited from class com.google.common.hash.AbstractHasher
putBoolean, putDouble, putFloat, putObject, putString, putUnencodedChars
-
Field Details
-
mac
-
done
private boolean done
-
-
Constructor Details
-
MacHasher
-
-
Method Details
-
update
protected void update(byte b) Description copied from class:AbstractByteHasher
Updates this hasher with the given byte.- Specified by:
update
in classAbstractByteHasher
-
update
protected void update(byte[] b) Description copied from class:AbstractByteHasher
Updates this hasher with the given bytes.- Overrides:
update
in classAbstractByteHasher
-
update
protected void update(byte[] b, int off, int len) Description copied from class:AbstractByteHasher
Updates this hasher withlen
bytes starting atoff
in the given buffer.- Overrides:
update
in classAbstractByteHasher
-
update
Description copied from class:AbstractByteHasher
Updates this hasher with bytes from the given buffer.- Overrides:
update
in classAbstractByteHasher
-
checkNotDone
private void checkNotDone() -
hash
Description copied from interface:Hasher
Computes a hash code based on the data that have been provided to this hasher. The result is unspecified if this method is called more than once on the same instance.
-