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 (Object delegate)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `String` | `computeHash(String password, User user)` Compute the hashed password given the unhashed password and the user
    `Object` | `getDelegate()`
    `String` | `getSalt(User user)` Retrieve the salt.
    `HashSaltStyle` | `getSaltStyle()` Get the defined io.vertx.groovy.ext.auth.mongo.HashSaltStyle of the current instance
    `String` | `getStoredPwd(User user)` Retrieve the password from the user, or as clear text or as hashed version, depending on the definition
    `void` | `setExternalSalt(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 Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### HashStrategy(Object delegate)

  - ### Method Detail

    - #### String computeHash(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

    - #### Object getDelegate()

    - #### 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

    - #### 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(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