Options
All
  • Public
  • Public/Protected
  • All
Menu

Class HashStrategy

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

Hierarchy

  • HashStrategy

Index

Methods

computeHash

  • computeHash(password: string, user: User): string
  • Compute the hashed password given the unhashed password and the user

    Parameters

    • password: string
    • user: User

    Returns string

getSalt

  • getSalt(user: User): string | null
  • 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 HashSaltStyle

    Parameters

    • user: User

    Returns string | null

getSaltStyle

  • Get the defined HashSaltStyle of the current instance

    Returns HashSaltStyle

getStoredPwd

  • getStoredPwd(user: User): string
  • Retrieve the password from the user, or as clear text or as hashed version, depending on the definition

    Parameters

    • user: User

    Returns string

setAlgorithm

  • Allows the selection of the hashing algorithm.

    Parameters

    Returns void

setExternalSalt

  • setExternalSalt(salt: string): void
  • Set an external salt. This method should be used in case of

    Parameters

    • salt: string

    Returns void

setSaltStyle

  • Set the saltstyle as defined by HashSaltStyle.

    Parameters

    Returns void

Generated using TypeDoc