pubsub.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:modernpython 作者: rhettinger 项目源码 文件源码
def hash_password(password: str, salt: Optional[bytes] = None) -> HashAndSalt:
    pepper = b'alchemists discovered that gold came from earth air fire and water'
    salt = salt or secrets.token_bytes(16)
    salted_pass = salt + password.encode('utf-8')
    return hashlib.pbkdf2_hmac('sha512', salted_pass, pepper, 100000), salt
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号