Notes
bcrpyt
title: install
pip install bcrypt
pip install pyjwt
title: code.py
import bcrypt
# example password
password = 'your_password'
# converting password to array of bytes
bytes = password.encode('utf-8')
# generating the salt
salt = bcrypt.gensalt()
# Hashing the password
hash = bcrypt.hashpw(bytes, salt)
# b to Database
# TODO
title: usage.py
import bcrypt
password = 'your_password'
b = bcrypt.checkpw(c.encode('utf-8'), b)
# b' from Database
# b와 b' 비교
title: 사용법.py import bcrypt 비밀번호 = 'your_password' b = bcrypt.checkpw(c.encode('utf-8'), b) # b' from Database # b와 b'비교
'Inbox' 카테고리의 다른 글
xcode 주요 환경 변수 (0) | 2024.01.30 |
---|---|
xcode downgrade (0) | 2024.01.30 |
ngrok localhost 외부 접속 (0) | 2024.01.30 |
ionic ios livereload (0) | 2024.01.30 |
bun (0) | 2024.01.30 |