Class DigestUtils


  • public class DigestUtils
    extends java.lang.Object
    DigestUtils.
    • Constructor Summary

      Constructors 
      Constructor Description
      DigestUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String md5Hex​(byte[] data)
      Calculates the MD5 digest and returns the value as a 32 character hex string.
      static java.lang.String md5Hex​(java.lang.String data)
      Calculates the MD5 digest and returns the value as a 32 character hex string.
      static java.lang.String sha512Hex​(java.lang.String data)
      Calculates the SHA-512 digest and returns the value as a hex string.
      • Methods inherited from class java.lang.Object

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

      • DigestUtils

        public DigestUtils()
    • Method Detail

      • sha512Hex

        public static java.lang.String sha512Hex​(java.lang.String data)
        Calculates the SHA-512 digest and returns the value as a hex string. if data is null or "" ,it will return null.
        Parameters:
        data - – Data to digest
        Returns:
        SHA-512 digest as a hex string.
      • md5Hex

        public static java.lang.String md5Hex​(java.lang.String data)
        Calculates the MD5 digest and returns the value as a 32 character hex string.
        Parameters:
        data - Data to digest
        Returns:
        MD5 digest as a hex string
      • md5Hex

        public static java.lang.String md5Hex​(byte[] data)
        Calculates the MD5 digest and returns the value as a 32 character hex string.
        Parameters:
        data - Data to digest
        Returns:
        MD5 digest as a hex string