carbond.security.BcryptHasher

extends Hasher

A utility class for the bcrypt hashing function

Instance Properties

rounds
integer
Default 10
Description the number of rounds to use XXX: The underlying bcryptjs library defaults to 10 rounds. Should probably explicitly define that.

Methods

eq  
Arguments
  • data (string) – the data in its raw form
  • digest (string) – the digest to compare against
Returns true if the data evaluates to digest
Return type boolean
Description Compares data against a bcrypt digest
getHasher
Inherited fromHasher
Arguments
  • name (string) – the name of a hasher. Supported hashers are noop, sha256, and bcrypt.
Returns the constructor for a hasher or undefined if not found
Return type function | undefined
Description Get a hasher class by name.
getHasherNames
Inherited fromHasher
Returns registered hasher names
Return type string[]
Description Get the names of all registered hashers.
hash  
Arguments
  • data (string) – the data to hash
Returns the digest
Return type string
Description Calculates the bcrypt digest of the input string