I use bcrypt-nodejs
to generate a hash in my node.js app like that:
var complete_string = "login" + "user@gmail.com";
var salt = "89Uhfdsua8aHK";
var hash = bcrypt.hashSync(complete_string, salt);
Then I try to check whether the hash from that string is correct using:
bcrypt.compareSync(complete_string, hash)); // true
But why does the compareSync
function outputs true
even though I'm not giving it any salt
parameter?