Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- MINUS
- Generic
- vuex
- Service
- docker
- docker-compose
- list
- Kotlin
- react native
- ReactNative
- lifecycle
- elementAt
- CLASS
- enum
- Interface
- LiveData
- class component
- Swift
- map
- Foreign Key
- animation
- Filter
- recyclerview
- function
- union
- ConstraintLayout
- AWS
- collection
- 생명주기
- mongoose
Archives
- Today
- Total
개발 일기
bcrypt ? 본문
bcrypt는 주로 비밀번호 저장을 암호화 할때 사용이 됩니다.
bcrypt는 강력한 해시 메커니즘중에 하나입니다.
node에서는 보통 bcrypt or bcrypt-node 이렇게 두개를 많이 사용합니다.
설치 패키지 :)
npm install --save bcrypt
기본 사용법 :)
- 암호화
import * as bcrypt from 'bcrypt';
const salt: string = await bcrypt.genSalt(10);
const hash: string = await bcrypt.hash(password, salt);
- 비교
const match: boolean = await bcrypt.compare(candidatePassword, this.password);
'서버 > Node.js' 카테고리의 다른 글
Database migration (db-migrate) (0) | 2020.05.02 |
---|---|
Node Mysql ? (0) | 2020.04.18 |
Node js 보안 - (1) (0) | 2020.04.11 |
Node Mailer 란? (0) | 2020.04.04 |
body-parser (0) | 2020.03.27 |
Comments