Package org.swisspush.gateleen.core.util
Class HashCodeGenerator
- java.lang.Object
-
- org.swisspush.gateleen.core.util.HashCodeGenerator
-
public final class HashCodeGenerator extends java.lang.ObjectGenerator 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.StringcreateHashCode(java.lang.String stringToHash)Calculates the HashCode of the provided input string.static java.lang.StringcreateHashCode(java.lang.String uri, java.lang.String payload)Joins the given parameters with a + and calculates the HashCode.static java.lang.StringcreateSHA256HashCode(java.lang.String dataToHash)Returns the SHA256 hash of the provided String ornullifnullhas been provided.
-
-
-
Method Detail
-
createHashCode
public static java.lang.String createHashCode(java.lang.String stringToHash)
Calculates the HashCode of the provided input string. Returnsnullif stringToHash isnull- 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. Returnsnullif uri and payload arenull- Parameters:
uri- uripayload- 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 ornullifnullhas been provided.- Parameters:
dataToHash- dataToHash- Returns:
- String
-
-