Skip to content

techieoriname/xpresser-bcrypt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XpresserJs Bcrypt Plugin

A library to help you hash passwords using Bcrypt.

This plugin makes use of bcrypt.

MENU

Installation

npm i @techie04/xpresser-bcrypt

# OR
yarn add @techie04/xpresser-bcrypt

Add to plugins.json

{
  "npm://@techie04/xpresser-bcrypt": true
}

Add to your project config.

({
  // ... Other Configs
    "bcrypt": {
        salt: 10,
    },
  
})

Usage

In your controller or anywhere in your project.

const { compare, hash } = require("@techie04/xpresser-bcrypt");

const password = "password"

// hash password
const hashed = hash(password)

// compare password and hash
compare(password, hashed) // return true

Typescript support

import { compare, hash } from "@techie04/xpresser-bcrypt";

const password: string = "password"

// hash password
const hashed = hash(password)

//compare password and hash
compare(password, hashed)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages