bcrypt-hashpass

hash pass with bcrypt

Usage no npm install needed!

<script type="module">
  import bcryptHashpass from 'https://cdn.skypack.dev/bcrypt-hashpass';
</script>

README

bcrypt-hashpass

Simple password hashing and comparing functions.

Usage

ENV

process.env.SALT_ROUNDS: number # 1, 2, 3, any number
rocess.env.PASS_SALT: string # generated salt. This can be ignore for automaticaly generated.

hash pass

import { hashPass, comparePassword } from 'bcrypt-hashpass';
const hashed = hashPass('mysecurepass');

compare password

import { hashPass, comparePassword } from 'bcrypt-hashpass';
const correct = comparePassword('mysecurepass', 'HashedPasswordXXX');