Class MessageDigestHashFunction.MessageDigestHasher

java.lang.Object
com.google.common.hash.AbstractHasher
com.google.common.hash.AbstractByteHasher
com.google.common.hash.MessageDigestHashFunction.MessageDigestHasher
All Implemented Interfaces:
Hasher, PrimitiveSink
Enclosing class:
MessageDigestHashFunction

private static final class MessageDigestHashFunction.MessageDigestHasher extends AbstractByteHasher
Hasher that updates a message digest.
  • Field Details

    • digest

      private final MessageDigest digest
    • bytes

      private final int bytes
    • done

      private boolean done
  • Constructor Details

    • MessageDigestHasher

      private MessageDigestHasher(MessageDigest digest, int bytes)
  • Method Details

    • update

      protected void update(byte b)
      Description copied from class: AbstractByteHasher
      Updates this hasher with the given byte.
      Specified by:
      update in class AbstractByteHasher
    • update

      protected void update(byte[] b, int off, int len)
      Description copied from class: AbstractByteHasher
      Updates this hasher with len bytes starting at off in the given buffer.
      Overrides:
      update in class AbstractByteHasher
    • update

      protected void update(ByteBuffer bytes)
      Description copied from class: AbstractByteHasher
      Updates this hasher with bytes from the given buffer.
      Overrides:
      update in class AbstractByteHasher
    • checkNotDone

      private void checkNotDone()
    • hash

      public HashCode 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.