Interface: PasswordStorageServiceInterface
Password Storage Service Interface
Methods
generateSalt()
generateSalt():
Promise
<string
>
Generate salt to be used to hash a password.
Returns
Promise
<string
>
Defined in
hash()
hash(
password
,options
?):Promise
<PasswordStorageInterface
>
Hash a password using a salt, if no was passed, then generate one automatically.
Parameters
Parameter | Type | Description |
---|---|---|
password | string | Password to be hashed |
options ? | PasswordHashOptionsInterface | Hash options |
Returns
Promise
<PasswordStorageInterface
>
Defined in
hashObject()
hashObject<
T
>(object
,options
?):Promise
<Omit
<T
,"password"
> |Omit
<T
,"password"
> &PasswordStorageInterface
>
Hash password for an object.
Type Parameters
Type Parameter |
---|
T extends PasswordPlainInterface |
Parameters
Parameter | Type | Description |
---|---|---|
object | T | An object containing the new password to hash. |
options ? | PasswordHashObjectOptionsInterface | Hash object options |
Returns
Promise
<Omit
<T
, "password"
> | Omit
<T
, "password"
> & PasswordStorageInterface
>
A new object with the password hashed, with salt added.