Interface Digest

All Superinterfaces:
Component
All Known Implementing Classes:
AbstractDigest, MD5Digest, SHA1Digest, SHA256Digest, SHA384Digest, SHA512Digest

public interface Digest extends Component
A general interface for a digest with utility methods to add java types into the digest.
Author:
Lee David Painter
  • Method Summary

    Modifier and Type
    Method
    Description
    byte[]
    Do the final processing and return the hash.
    void
    Update the digest with a BigInteger value.
    void
    putByte(byte b)
    Put a single byte into the digest.
    void
    putBytes(byte[] data)
    Put a byte array into the digest.
    void
    putBytes(byte[] data, int offset, int len)
    Put a byte array into the digest
    void
    putInt(int i)
    Put an integer into the digest.
    void
    Put a String into the digest.
    void
    Reset the underlying digest.
  • Method Details

    • putBigInteger

      void putBigInteger(BigInteger bi)
      Update the digest with a BigInteger value. This puts both the integer length of the BigInteger data and the binary data.
      Parameters:
      bi -
    • putByte

      void putByte(byte b)
      Put a single byte into the digest.
      Parameters:
      b -
    • putBytes

      void putBytes(byte[] data)
      Put a byte array into the digest.
      Parameters:
      data -
    • putBytes

      void putBytes(byte[] data, int offset, int len)
      Put a byte array into the digest
      Parameters:
      data -
      offset -
      len -
    • putInt

      void putInt(int i)
      Put an integer into the digest.
      Parameters:
      i -
    • putString

      void putString(String str)
      Put a String into the digest.
      Parameters:
      str -
    • reset

      void reset()
      Reset the underlying digest.
    • doFinal

      byte[] doFinal()
      Do the final processing and return the hash.
      Returns:
      the hash