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