사용목적
설치하기
npm install bcrypt
사용하기
import dotenv from 'dotent';
import bycrypt from 'bcrypt';
const password = "12345";
// env파일을 사용하기 위한 라이브러리
dotenv.config();
// 암호화를 위한 key
const salt = Number(process.env.PASSWORD_SALT);
// 해쉬 비밀번호 생성
const hashPassword = await bycrypt.hash(password, salt);
console.log(hashPassword);
// 두 패스워드 일치하는지 비교
const isCorrect = await bycrypt.compare(password, hashPassword);

Key Generator : https://randomkeygen.com/