Skip to content

Using bcrypt.hash #66

@LinaYahya

Description

@LinaYahya

const hashPassword = (password, callback) => {
bcrypt.genSalt(10, (err, salt) => {
if (err) {
console.log(err);
} else {
bcrypt.hash(password, salt, callback);

returning to bcrypt we can generate hash in one step, check bcryptjs hash api to auto-gen hash and salt, and again as this method return promise so try to avoid callbacks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions