FACN3 / umm-el-fahem

authentication project
0 stars 0 forks source link

Combine salt and hash #46

Open matthewdking opened 6 years ago

matthewdking commented 6 years ago

Bcrypt hash function takes in a 3 arguments value, salt and callback. If the salt is a number however it does the bcrypt.salt function for you. Its just slighter fewer lines of code.

bcrypt.hash(data.password, 10, function(err, hash) {
        if (err) {
          console.log(err);
        } else {
          // do some other stuff