1.0.0 • Published 1 year ago

@hailemelekot/bicrypt v1.0.0

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Install

$ npm install bicrypt

After installing with npm you can require this library from JavaScript:

JavaScript

const bicrypt = require("bicrypt");

Usage

Example for encripting a password

const bicrypt = require("bicrypt");

bicrypt
  .hash(
    "hailemelekot12345", // password
    "Secret" //Secret from your .env variable
  )
  .then((res) => {
    console.log(res); //set res to database, that is encripted password
  });

Example for verifying a password

const bicrypt = require("bicrypt");

bicrypt
  .verify(
    "hailemelekot12345", // password
    "04570b03002a03c4983a", // generated hex. may be from your database
    "Secret" //Secret from your .env variable
  )
  .then((res) => {
    console.log(res);
    // Return true or false
  });
You can contact me at:-
Email: Hailemelekotmelakie1991@gmail.com