org.eclipse.viatra.dse.util

## Class Hasher

- java.lang.Object
- - org.eclipse.viatra.dse.util.Hasher

-     public final class Hasher
      extends java.lang.Object

  Utility class that encapsulates a `MessageDigest` instance to aid calculating hash values more easily, and to reuse a `MessageDigest` instance.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `SHA1_PROTOCOLL`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static Hasher` | `getHasher(java.lang.String protocoll)` Returns a `Hasher` with an internal `MessageDigest` that is based on the protocol named `protocoll`.
    `java.lang.String` | `hash(java.lang.String data)` Calculates and returns a hash value.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### SHA1_PROTOCOLL

          public static final java.lang.String SHA1_PROTOCOLL

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### hash

          public java.lang.String hash(java.lang.String data)

      Calculates and returns a hash value.
      Parameters:
        `data` - the data to be hashed in a `String`.
      Returns:
        the hash value in some `String` representation.

    - #### getHasher

          public static Hasher getHasher(java.lang.String protocoll)

      Returns a `Hasher` with an internal `MessageDigest` that is based on the protocol named `protocoll`.
      Parameters:
        `protocoll` - the name of the hash algorythm.
      Returns:
        the initialized `Hasher`
      Throws:
        `DSEException` - on initialization failure.