Python bcrypt

From wikinotes
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')