使用的模块Security Helpers
示例代码如下:
# -*- coding: utf-8 -*-
from werkzeug.security import generate_password_hash, check_password_hash
pwd = '123456'
pwd_hash1 = generate_password_hash(pwd)
pwd_hash2 = generate_password_hash(pwd)
print(pwd_hash1)
print(pwd_hash2)
print(check_password_hash(pwd_hash1, pwd))
print(check_password_hash(pwd_hash2, pwd))
网友评论