Class UnicityHasher

java.lang.Object
fr.paris.lutece.plugins.identitystore.utils.UnicityHasher

public final class UnicityHasher extends Object
Provides static method to compute a hash code based on a map of key/value.
  • Field Details

  • Constructor Details

    • UnicityHasher

      public UnicityHasher()
  • Method Details

    • computeHash

      public static String computeHash(Map<String,String> values) throws fr.paris.lutece.plugins.identitystore.web.exception.IdentityStoreException
      Compute 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