dcodeIO / bcrypt.js

Optimized bcrypt in plain JavaScript with zero dependencies.
Other
3.47k stars 264 forks source link

bcrypt.compare return success in 2.3.0 but failed in 2.4.3 #59

Closed dongtong closed 6 years ago

dongtong commented 7 years ago

Hi

bcrypt.compare(password, this.Password, function(err, passwordMatched){
        console.log('passwordMatched----',passwordMatched)
});

the above code, no matter what correct or incorrect password, the passwordMatched is always false

obetame commented 7 years ago

me too.

rpgeeganage commented 7 years ago

Hi @dongtong , Can you please give a sample passwords which fails. Because following example does gives me 'true' for the comparison.

'use strict';

const bcrypt = require('bcryptjs');
const salt = bcrypt.genSaltSync(10);
const hash = bcrypt.hashSync('B4c0/\/', salt);

bcrypt.compare("B4c0/\/", hash, function(err, res) {
    console.log('err----> ',err);
        console.log('res----> ',res);
});
Ruffio commented 6 years ago

@dongtong is this still an issue?