I'm seeing bcryptjs beat twin every time with the following code:

var bcryptJS = require('bcryptjs');
var twinBcrypt = require('twin-bcrypt');

var password = "password";
var rounds = 12;
var hash, start, end;

// twin-bcrypt
start = new Date();
hash = twinBcrypt.hashSync(password, twinBcrypt.genSalt(rounds));
end = new Date();
console.log("Took \t" + (end - start) + "ms\t to hash '" + password + "'
into '" + hash + "'");

// bcryptjs
start = new Date();
hash = bcryptJS.hashSync(password, bcryptJS.genSaltSync(rounds));
end = new Date();
console.log("Took \t" + (end - start) + "ms\t to hash '" + password + "'
into '" + hash + "'");

On my Mac, BJS comes in at ~950ms and twim, ~1700ms.

>From the description of twin-bcrypt, I'd expect it to be quicker.

Does my test code look OK? Am I mis-using the libs?

Thanks.

Adrian

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAH368SSHMxGhSWepY5bOETSdkW8uY76b%3D8FFm6Tk6yt2aKWVRQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to