Skip to main content

Module password

Module password 

Source
Expand description

Password hashing.

Upstream is src/password.js: bcrypt.hash(password, 10), using bcryptjs by default and @node-rs/bcrypt when it can be required.

The cost factor and the output format are interop contract, not implementation detail. A _User row written by parse-rust must be loginable by parse-server and the reverse, on the same database. That is a mixed-fleet requirement, and it is the kind of thing that looks fine until a second server exists. tests/bcrypt_interop.rs checks both directions against Node.

Constants§

BCRYPT_COST
Upstream’s cost factor (password.js, bcrypt.hash(password, 10)).

Functions§

hash
Hash a password for storage in _User._hashed_password.
verify
Verify a password against a stored hash.