bcryption

1.0.1 • Public • Published

Install

$ npm install bcryption

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

JavaScript

const bcryption = require("bcryption");

Usage

Example for encripting a password

const bcryption = require("bcryption");

bcryption
  .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 bcryption = require("bcryption");

bcryption
  .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

/bcryption/

    Package Sidebar

    Install

    npm i bcryption

    Weekly Downloads

    1

    Version

    1.0.1

    License

    ISC

    Unpacked Size

    12.7 kB

    Total Files

    8

    Last publish

    Collaborators

    • hailemelekot