shaneMangudi / bcrypt-nodejs

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

[Compatibility] Passing a number as salt parameter doesn't work #22

Open ysulyma opened 10 years ago

ysulyma commented 10 years ago

From node.bcrypt.js documentation:

salt - [REQUIRED] - the salt to be used to hash the password. if specified as a number then a salt will be generated and used (see examples).

If I do this in bcrypt-nodejs, I get

TypeError: Object 1 has no method 'charAt'
Ryanc1256-zz commented 10 years ago

Yeah, Currently this one doesn't support numbers, it only accepts the a function s..

bcrypt.hashSync('my password', bcrypt.genSaltSync(10));

There is an issue already for this module to implement the way of the other module so you can put in numbers but I have no idea when that will get added...

Sorry for the late reply.