Skip to Content
NFSFU234FormValidation v3 is here — file upload validation, config-driven rules, and more.
v2 (legacy)hashPassword

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

ParameterTypeDefaultDescription
passwordstringundefinedThe 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