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'=')
评论列表
文章目录