Package: io.vertx.groovy.ext.auth.mongo

## [Groovy] Class HashStrategy

- io.vertx.groovy.ext.auth.mongo.HashStrategy

- Determines how the hashing is computed in the implementation You can implement this to provide a different hashing strategy to the default.

- - ### Constructor Summary

    Constructors
    Constructor and description
    `HashStrategy (java.lang.Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.lang.String` | `computeHash(java.lang.String password, User user)` Compute the hashed password given the unhashed password and the user
    `java.lang.Object` | `getDelegate()`
    `java.lang.String` | `getSalt(User user)` Retrieve the salt.
    `HashSaltStyle` | `getSaltStyle()` Get the defined io.vertx.groovy.ext.auth.mongo.HashSaltStyle of the current instance
    `java.lang.String` | `getStoredPwd(User user)` Retrieve the password from the user, or as clear text or as hashed version, depending on the definition
    `void` | `setExternalSalt(java.lang.String salt)` Set an external salt.
    `void` | `setSaltStyle(HashSaltStyle saltStyle)` Set the saltstyle as defined by io.vertx.groovy.ext.auth.mongo.HashSaltStyle.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Constructor Detail

    - #### HashStrategy(java.lang.Object delegate)

  - ### Method Detail

    - #### java.lang.String computeHash(java.lang.String password, User user)

      Compute the hashed password given the unhashed password and the user

      Returns:
        the hashed password
      Parameters:
        `password` - the unhashed password
        `user` - the user to get the salt for. This paramter is needed, if the is declared to be used

    - #### java.lang.Object getDelegate()

    - #### java.lang.String getSalt(User user)

      Retrieve the salt. The source of the salt can be the external salt or the propriate column of the given user, depending on the defined io.vertx.groovy.ext.auth.mongo.HashSaltStyle

      Returns:
        null in case of the salt of the user or a defined external salt
      Parameters:
        `user` - the user to get the salt for. This paramter is needed, if the is declared to be used

    - #### HashSaltStyle getSaltStyle()

      Get the defined io.vertx.groovy.ext.auth.mongo.HashSaltStyle of the current instance

      Returns:
        the saltStyle

    - #### java.lang.String getStoredPwd(User user)

      Retrieve the password from the user, or as clear text or as hashed version, depending on the definition

      Returns:
        the password, either as hashed version or as cleartext, depending on the preferences
      Parameters:
        `user` - the user to get the stored password for

    - #### void setExternalSalt(java.lang.String salt)

      Set an external salt. This method should be used in case of

      Parameters:
        `salt` - the salt, which shall be used

    - #### void setSaltStyle(HashSaltStyle saltStyle)

      Set the saltstyle as defined by io.vertx.groovy.ext.auth.mongo.HashSaltStyle.

      Parameters:
        `saltStyle` - the io.vertx.groovy.ext.auth.mongo.HashSaltStyle to be used