Class UnicityHasher
java.lang.Object
fr.paris.lutece.plugins.identitystore.utils.UnicityHasher
Provides static method to compute a hash code based on a map of key/value.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcomputeHash(Map<String, String> values) Compute a hash code, based on a map of key/value.
-
Field Details
-
ALGORITHM
- See Also:
-
-
Constructor Details
-
UnicityHasher
public UnicityHasher()
-
-
Method Details
-
computeHash
public static String computeHash(Map<String, String> values) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreExceptionCompute a hash code, based on a map of key/value.
Before computing the 128 bits SHA-256 hash, the map is sorted by keys, and the values are trimmed and lowercased, then computed in a string with a | separator.
The computation follows the schema: key=value.trim().toLowerCase()- Parameters:
values- map of key/value to be hashed- Returns:
- 32 chars hex string (128 bits)
- Throws:
fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
-