Class HashCodeGenerator


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

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String createHashCode​(java.lang.String stringToHash)
      Calculates the HashCode of the provided input string.
      static java.lang.String createHashCode​(java.lang.String uri, java.lang.String payload)
      Joins the given parameters with a + and calculates the HashCode.
      static java.lang.String createSHA256HashCode​(java.lang.String dataToHash)
      Returns the SHA256 hash of the provided String or null if null has been provided.
      • Methods inherited from class java.lang.Object

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

      • createHashCode

        public static java.lang.String createHashCode​(java.lang.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 java.lang.String createHashCode​(java.lang.String uri,
                                                      java.lang.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 java.lang.String createSHA256HashCode​(java.lang.String dataToHash)
        Returns the SHA256 hash of the provided String or null if null has been provided.
        Parameters:
        dataToHash - dataToHash
        Returns:
        String