kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.49k stars 517 forks source link

Add salt argument to compare/compareSync #295

Closed andrewjmead closed 9 years ago

andrewjmead commented 9 years ago

First, great library. Thanks.

I'm using a salt for my passwords and found it odd that when hashing my password there was an argument for the salt, but when comparing my passwords there is not. I was assuming the syntax would be something like:

var isMatch = bcrypt.hashSync(password, salt, hashedPassword);

Is this something you would consider doing or consider accepting a PR for?

ncb000gt commented 9 years ago

bcrypt salts are stored as a part of the hash and are therefore not required in the comparison as a separate parameter. :)