dcodeIO / bcrypt.js

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

genSalt (async) with no arguments throws callback error instead of returning promise #58

Closed IRCraziestTaxi closed 7 years ago

IRCraziestTaxi commented 7 years ago

I am using bcryptjs in a node/express application and received an error about an undefined argument when trying to run the callback for genSalt although the documentation specifies that since 2.4.0 (which is the version I have) an omitted callback means genSalt will return a promise. I have to specify the number of rounds in order to get a promise back; I cannot use genSalt() with no arguments.