backends.py 文件源码

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

项目:webtzite 作者: materialsproject 项目源码 文件源码
def default_username_algo(email):
    # store the username as a base64 encoded sha1 of the email address
    # this protects against data leakage because usernames are often
    # treated as public identifiers (so we can't use the email address).
    return base64.urlsafe_b64encode(
        hashlib.sha1(smart_bytes(email)).digest()
    ).rstrip(b'=')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号