hashPassword
The hashPassword function hashes a plain text password using bcrypt and returns the hashed password as a promise.
Works in: Node.js, React JS, HTML5
| Parameter | Type | Default | Description |
|---|---|---|---|
password | string | undefined | The password to be hashed. |
Usage
Example: Hash a Password
nfsfu234FormValidation.hashPassword('@Password12345')
.then(hashedPassword => {
console.log(hashedPassword); // The hashed password
})
.catch(error => {
console.error("Error hashing password: ", error);
});See also
Last updated on