Class HashUtils


  • public class HashUtils
    extends Object
    Utility for Secure hashes
    • Constructor Detail

      • HashUtils

        public HashUtils()
    • Method Detail

      • sha1

        public static String sha1​(byte[] data)
        Compute a SHA-1 hash using Java built-in MessageDigest, and format the result in hex. Beware that hash-computation is a CPU intensive operation
        Parameters:
        data -
        Returns:
      • sha256

        public static String sha256​(byte[] data)
        Compute a SHA-256 hash using Java built-in MessageDigest, and format the result in hex. Beware that hash-computation is a CPU intensive operation
        Parameters:
        data -
        Returns:
      • md5

        public static String md5​(byte[] data)
        Compute a MD5 hash using Java built-in MessageDigest, and format the result in hex. Beware that hash-computation is a CPU intensive operation
        Parameters:
        data -
        Returns:
      • arraytohexstring

        public static String arraytohexstring​(byte[] bytes)