Node.bcrypt.js: [Question] Difference between bcrypt and bcryptjs

Created on 13 Feb 2019  路  8Comments  路  Source: kelektiv/node.bcrypt.js

Newbie here. I can't figure out the differences between the bcrypt and bcryptjs libraries.

They both have 100s of thousands of downloads on npm every week. Are there any differences between them that are important enough to use one or the other?

question

Most helpful comment

https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js

Short summary: bcrypt is a native (C++) module, thus much faster than bcryptjs which is a pure js module.

bcrypt sometimes requires additional steps to build correctly, especially if you are using architectures other than x86_64 or a glibc based distro. You will need additional dependencies to compile from source.

bcryptjs is plain js, hence works everywhere, even browsers. bcrypt runs only on NodeJS, Node-WebKit or Electron.

All 8 comments

https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js

Short summary: bcrypt is a native (C++) module, thus much faster than bcryptjs which is a pure js module.

bcrypt sometimes requires additional steps to build correctly, especially if you are using architectures other than x86_64 or a glibc based distro. You will need additional dependencies to compile from source.

bcryptjs is plain js, hence works everywhere, even browsers. bcrypt runs only on NodeJS, Node-WebKit or Electron.

@agathver Thanks! That is the first clear explanation I've found.

One more thing, this version uses native C++ bindings. Does that mean that it won't bog down the main user thread (because it can offload to native code using multiple threads)? Since node has a single user thread, I don't want my app to grind to a halt when hashing passwords...

@lonix1 Yes. We offload the computation to a background thread so that we don't block the event loop.

However, a single user will probably not notice this. The hash calculation is under a second for reasonable settings.

@agathver Thanks for taking the time to help, appreciated!

https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js

Short summary: bcrypt is a native (C++) module, thus much faster than bcryptjs which is a pure js module.

bcrypt sometimes requires additional steps to build correctly, especially if you are using architectures other than x86_64 or a glibc based distro. You will need additional dependencies to compile from source.

bcryptjs is plain js, hence works everywhere, even browsers. bcrypt runs only on NodeJS, Node-WebKit or Electron.

Thanks for the response, really helpful.

https://github.com/kelektiv/node.bcrypt.js/wiki/bcrypt-vs-brypt.js

Short summary: bcrypt is a native (C++) module, thus much faster than bcryptjs which is a pure js module.

bcrypt sometimes requires additional steps to build correctly, especially if you are using architectures other than x86_64 or a glibc based distro. You will need additional dependencies to compile from source.

bcryptjs is plain js, hence works everywhere, even browsers. bcrypt runs only on NodeJS, Node-WebKit or Electron.

Thanks for the response, really helpful.

. what bwt the syntax ?

Was this page helpful?
0 / 5 - 0 ratings