Package generic.hash

Class AbstractMessageDigest

    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.lang.String algorithm  
      int digestLength  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected AbstractMessageDigest​(java.lang.String algorithm, int digestLength)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      byte[] digest()
      Completes the hash computation by performing final operations such as padding.
      java.lang.String getAlgorithm()
      Returns a string that identifies the algorithm, independent of implementation details.
      int getDigestLength()
      Returns the length of the digest in bytes.
      void update​(byte[] input)
      Updates the digest using the specified array of bytes.
      void update​(byte[] input, int offset, int len)
      You REALLY want to override this method.
      void update​(byte[] input, int offset, int len, TaskMonitor monitor)
      You REALLY want to override this method too.
      void update​(byte[] input, TaskMonitor monitor)
      Updates the digest using the specified array of bytes.
      void update​(int input)
      Updates the digest using the specified int.
      void update​(long input)
      Updates the digest using the specified long.
      void update​(short input)
      Updates the digest using the specified short.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • algorithm

        public final java.lang.String algorithm
      • digestLength

        public final int digestLength
    • Constructor Detail

      • AbstractMessageDigest

        protected AbstractMessageDigest​(java.lang.String algorithm,
                                        int digestLength)
    • Method Detail

      • getAlgorithm

        public final java.lang.String getAlgorithm()
        Description copied from interface: MessageDigest
        Returns a string that identifies the algorithm, independent of implementation details.
        Specified by:
        getAlgorithm in interface MessageDigest
        Returns:
        the name of the algorithm
      • getDigestLength

        public final int getDigestLength()
        Description copied from interface: MessageDigest
        Returns the length of the digest in bytes.
        Specified by:
        getDigestLength in interface MessageDigest
        Returns:
        the digest length in bytes
      • digest

        public final byte[] digest()
        Description copied from interface: MessageDigest
        Completes the hash computation by performing final operations such as padding. The digest is reset after this call is made.
        Specified by:
        digest in interface MessageDigest
        Returns:
        the array of bytes for the resulting hash value
      • update

        public final void update​(byte[] input)
        Description copied from interface: MessageDigest
        Updates the digest using the specified array of bytes. Do not use a monitor
        Specified by:
        update in interface MessageDigest
        Parameters:
        input - the array of bytes
      • update

        public void update​(short input)
        Description copied from interface: MessageDigest
        Updates the digest using the specified short.
        Specified by:
        update in interface MessageDigest
        Parameters:
        input - the short with which to update the digest (big endian)
      • update

        public void update​(int input)
        Description copied from interface: MessageDigest
        Updates the digest using the specified int.
        Specified by:
        update in interface MessageDigest
        Parameters:
        input - the int with which to update the digest (big endian)
      • update

        public void update​(long input)
        Description copied from interface: MessageDigest
        Updates the digest using the specified long.
        Specified by:
        update in interface MessageDigest
        Parameters:
        input - the long with which to update the digest (big endian)
      • update

        public void update​(byte[] input,
                           int offset,
                           int len)
        You REALLY want to override this method.
        Specified by:
        update in interface MessageDigest
        Parameters:
        input - the array of bytes
        offset - the offset to start from in the array of bytes
        len - the number of bytes to use, starting at offset
      • update

        public void update​(byte[] input,
                           int offset,
                           int len,
                           TaskMonitor monitor)
                    throws CancelledException
        You REALLY want to override this method too.
        Specified by:
        update in interface MessageDigest
        Parameters:
        input - the array of bytes
        offset - the offset to start from in the array of bytes
        len - the number of bytes to use, starting at offset
        monitor - the monitor to check during loops
        Throws:
        CancelledException