shaneMangudi / bcrypt-nodejs

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

genSalt rounds isn't optional #19

Open remy opened 11 years ago

remy commented 11 years ago

This line: https://github.com/shaneGirish/bcrypt-nodejs/blob/master/bCrypt.js#L585 shows that the rounds isn't optional, as the callback is checked without first checking that rounds wasn't passed in.

i.e. I'd expect the code to read (something like):

if (typeof rounds === 'function' && callback === undefined) {
  callback = rounds;
  rounds = 0;
}

// ...

So it can be called with bcrypt.genSalt(fn) (if rounds is really optional).

cjduncana commented 8 years ago

Hello @remy: Today, I just did a pull request that fixes this problem. It seems, though, that this repository is not being updated. The last commit was almost a year ago. I suggest that, in the meantime, you use my version of the repository: npm install --save https://github.com/cjduncana/bcrypt-nodejs.git. When @shaneGirish accepts my pull request, I'll let you know so that you can go back t this repository.