shaneMangudi / bcrypt-nodejs

Native implementation of bcrypt for NodeJS
Other
574 stars 69 forks source link

Added hashSync overload that accepts rounds instead of salt instance #52

Closed bookercodes closed 1 year ago

bookercodes commented 9 years ago

Outline I added an overload to the hashSync function that accepts the number of rounds to use.

Benefit Instead of having to create a salt instance and pass it to the hashSync function:

var salt = bCrypt.genSaltSync(12);
var hash = bCrypt.hashSync('super secret', salt);

Consumers can now supply the number of rounds directly, as an argument:

var hash = bCrypt.hashSync('super secret', 12);

This is similar to how node.bcrypt.js works.

Todo

I am happy to do all these things, I just want to check that this is something that you would actually consider merging first.

Thank you!