shaneMangudi / bcrypt-nodejs

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

Use strict mode not working #59

Open Vinorcola opened 9 years ago

Vinorcola commented 9 years ago

Hello,

This library is not compatible with "use strict" mode. If you launch a project with:

node --use_strict --harmony myProject.js

Then, the following errors occurs:

./node_modules/bcrypt-nodejs/bCrypt.js:519
    password = password + (minor >= 'a' ? "\000" : "");
                                            ^^
SyntaxError: Octal literals are not allowed in strict mode.

Would it be possible to fix this?

Thanks

doliver3 commented 8 years ago

Yes, could this be fixed please? node_modules/bcrypt-nodejs/bCrypt.js:519 password = password + (minor >= 'a' ? "\000" : "");

I'd prefer to enable ES6 everywhere in native node 4.x but I can't when dependent modules like this don't support 'use strict' mode.

Vinorcola commented 8 years ago

@doliver3 This module seems not to be maintain anymore.

I switch to https://www.npmjs.com/package/bcrypt. I suggest you do the same ;)

saul-leon commented 7 years ago

This worked for me: password = password + (minor >= 'a' ? parseInt('000', 8) : "");