Class SHA5DigestHybrid

  • All Implemented Interfaces:
    java.lang.Cloneable

    public final class SHA5DigestHybrid
    extends java.security.MessageDigestSpi
    This class is a facade for the SHA5 message digest algorithm. The alias names "SHA-5" and "SHA5" which refer to this implementation are deprecated, use "SHA512" or "SHA-512" as replacement alias names.
    • Constructor Summary

      Constructors 
      Constructor Description
      SHA5DigestHybrid()
      Creates an instance of the SHA5DigestHybrid class.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()
      Clones this object.
      protected byte[] engineDigest()
      Computes and returns the MD5 hash.
      protected int engineDigest​(byte[] buf, int offset, int len)
      Computes and returns the MD5 hash in the buffer provided.
      protected int engineGetDigestLength()
      Return the digest length in bytes.
      protected void engineReset()
      Resets the MD5 information back to starting values.
      protected void engineUpdate​(byte b)
      Update adds the passed byte to the digested data.
      protected void engineUpdate​(byte[] input)
      Update adds the passed byte array to the digested data.
      protected void engineUpdate​(byte[] input, int offset, int len)
      Update adds the selected part of an array of bytes to the digest.
      • Methods inherited from class java.security.MessageDigestSpi

        engineUpdate
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SHA5DigestHybrid

        public SHA5DigestHybrid()
        Creates an instance of the SHA5DigestHybrid class.
    • Method Detail

      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Clones this object.
        Overrides:
        clone in class java.security.MessageDigestSpi
        Throws:
        java.lang.CloneNotSupportedException
      • engineReset

        protected void engineReset()
        Resets the MD5 information back to starting values.
        Specified by:
        engineReset in class java.security.MessageDigestSpi
      • engineGetDigestLength

        protected int engineGetDigestLength()
        Return the digest length in bytes.
        Overrides:
        engineGetDigestLength in class java.security.MessageDigestSpi
      • engineUpdate

        protected void engineUpdate​(byte b)
        Update adds the passed byte to the digested data.
        Specified by:
        engineUpdate in class java.security.MessageDigestSpi
        Parameters:
        b - is the byte to add to the digest.
      • engineUpdate

        protected void engineUpdate​(byte[] input)
        Update adds the passed byte array to the digested data.
        Parameters:
        input - is the byte array to add to the digest.
      • engineUpdate

        protected void engineUpdate​(byte[] input,
                                    int offset,
                                    int len)
        Update adds the selected part of an array of bytes to the digest. This version is more efficient than the byte-at-a-time version; it avoids data copies and reduces per-byte call overhead.
        Specified by:
        engineUpdate in class java.security.MessageDigestSpi
        Parameters:
        input - array used to update the digest.
        offset - the offset into the array.
        len - the length of the array.
      • engineDigest

        protected byte[] engineDigest()
        Computes and returns the MD5 hash.
        Specified by:
        engineDigest in class java.security.MessageDigestSpi
        Returns:
        the hash.
      • engineDigest

        protected int engineDigest​(byte[] buf,
                                   int offset,
                                   int len)
                            throws java.security.DigestException
        Computes and returns the MD5 hash in the buffer provided.
        Overrides:
        engineDigest in class java.security.MessageDigestSpi
        Parameters:
        buf - the buffer to put the MD5 hash into.
        offset - is the offset in the buffer into which to copy the hash.
        len - the length of the buffer.
        Returns:
        the length of the hash.
        Throws:
        java.security.DigestException - is thrown when the array is not large enough to hold the digest.