Python bcrypt

From wikinotes
Revision as of 18:14, 20 March 2019 by Will (talk | contribs) (Created page with "<source lang="python"> import bcrypt hashed_pw = bcrypt.hashpw('password'.encode('utf-8'), bcrypt.gensalt()) if bcrypt.checkpw(password.encode('utf-8'), hashed_pw): print...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
import bcrypt

hashed_pw = bcrypt.hashpw('password'.encode('utf-8'), bcrypt.gensalt())
if bcrypt.checkpw(password.encode('utf-8'), hashed_pw):
    print('password is valid')