- Hash passwords
- Custom rounds for salt
- Verify hashed passwords
- Faster than the pure JS implementation
- Pre-requisites:
- NPM
npm i -s bcrypt-rust-wasm
This library is currently compatible with NodeJS and supports the synchronous bindings only.
const { Bcrypt } = require('bcrypt-rust-wasm');
...
// Get a bcrypt instance with a default number of seed rounds
const bcryptDefault = Bcrypt.default();
// Get a bcrypt instance with a specified number of seed rounds
const bcrypt = Bcrypt.new(10);
const hash = bcrypt.hashSync('password');
// hash: "$2b$04$fsiGFAMtgNJ8YIszhoxusObEgoLF.faqMIKXiRDp5GZbzFWzebgcu"
bcrypt.verifySync("password", hash) // true
bcrypt.verifySync("password123", hash) // false
# Builds the project and places it into the `pkg` folder.
npm run build
- @ATechnoHazard - for the implementation
- @L04DB4L4NC3R - for the idea
Made with ❤️ by DSC VIT