Class HashCodeGenerator


  • public final class HashCodeGenerator
    extends Object
    Generator for HashCode values.
    Author:
    https://github.com/mcweba [Marc-Andre Weber]
    • Method Detail

      • createHashCode

        public static String createHashCode​(String stringToHash)
        Calculates the HashCode of the provided input string. Returns null if stringToHash is null
        Parameters:
        stringToHash - the input string to hash
        Returns:
        the HashCode of the input string or null when stringToHash was null
      • createHashCode

        public static String createHashCode​(String uri,
                                            String payload)
        Joins the given parameters with a + and calculates the HashCode. Returns null if uri and payload are null
        Parameters:
        uri - uri
        payload - payload
        Returns:
        the HashCode of the concatenation (+) of the given parameters
      • createSHA256HashCode

        public static String createSHA256HashCode​(String dataToHash)
        Returns the SHA256 hash of the provided String or null if null has been provided.
        Parameters:
        dataToHash - dataToHash
        Returns:
        String