generate_password_hash和check_password_hash

generate_password_hash:对密码明文密码加盐,生成加密后的hash字符串

 generate_password_hash('123')
'pbkdf2:sha256:150000$DWt7OJXb$1e561fab7cf24bd0bd691c8b3bd7d235867cb3b567043b80a46ee367b8814467'

check_password_hash:将密码和hash字符串进行比对,返回true或false

check_password_hash(generate_password_hash('123'),'123')
True

 

posted @ 2020-06-23 16:05  梁十安  阅读(2130)  评论(0编辑  收藏  举报