0.1.9 • Published 4 years ago

bcrypt-rust-wasm v0.1.9

Weekly downloads
21
License
MIT
Repository
github
Last release
4 years ago

npm version


Functionalities

  • Hash passwords
  • Custom rounds for salt
  • Verify hashed passwords
  • Faster than the pure JS implementation

Instructions to run

  • Pre-requisites: - NPM

Installation with NPM

npm i -s bcrypt-rust-wasm

Usage

This library is currently compatible with NodeJS and supports the synchronous bindings only.

Importing

const { Bcrypt } = require('bcrypt-rust-wasm');
...

Obtaining an instance

// 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);

Hashing

const hash = bcrypt.hashSync('password'); 
// hash: "$2b$04$fsiGFAMtgNJ8YIszhoxusObEgoLF.faqMIKXiRDp5GZbzFWzebgcu"

Verifying a hash

bcrypt.verifySync("password", hash) // true
bcrypt.verifySync("password123", hash) // false

Building from source

How to build in release mode

# Builds the project and places it into the `pkg` folder.
npm run build

Dependencies for building

Contributors

0.1.9

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.6

4 years ago

0.1.5

4 years ago

0.1.4

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago