[bcrypt] 비번 암호화

jungeundelilahLEE·2021년 6월 9일
0
  • bcrypt 설치
  • route를 위해 해당 라우트에서
  • 유저의 정보를 DB에 저장하기 전에 암호화
  • bcrypt 문서 참고
const bcrypt = require('bcrypt');
const saltRounds = 10; // 자릿수
const myPlaintextPassword = 's0/\/\P4$$w0rD';
const someOtherPlaintextPassword = 'not_bacon';

bcrypt.genSalt(saltRounds, function(err, salt) {
    bcrypt.hash(myPlaintextPassword, salt, function(err, hash) {
        // Store hash in your password DB.
    });
});

postman send! password hash success!!!

에러때문에... 한참 헤멨다...

profile
delilah's journey

0개의 댓글