Class Hash


  • public class Hash
    extends java.lang.Object
    This class consists exclusively of static methods that generate a cryptographic hash of the given string. All the methods return an empty string if the input string is null.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String md5​(java.lang.String input)
      Generate MD5 hash of a string
      static java.lang.String sha256​(java.lang.String input)
      Generate SHA-256 hash of a string
      static java.lang.String sha512​(java.lang.String input)
      Generate SHA-512 hash of a string
      • Methods inherited from class java.lang.Object

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

      • sha256

        public static java.lang.String sha256​(java.lang.String input)
        Generate SHA-256 hash of a string
        Parameters:
        input - The input string to generate hash for
        Returns:
        The hash of the string. Returns an empty string if the provided input is null.
      • sha512

        public static java.lang.String sha512​(java.lang.String input)
        Generate SHA-512 hash of a string
        Parameters:
        input - The input string to generate hash for
        Returns:
        The hash of the string. Returns an empty string if the provided input is null.
      • md5

        public static java.lang.String md5​(java.lang.String input)
        Generate MD5 hash of a string
        Parameters:
        input - The input string to generate hash for
        Returns:
        The hash of the string. Returns an empty string if the provided input is null.