def _username_algo()

in moderator/settings.py [0:0]


def _username_algo(email):
    import base64
    import hashlib

    try:
        from django.utils.encoding import smart_bytes
    except ImportError:
        from django.utils.encoding import smart_str as smart_bytes

    return base64.urlsafe_b64encode(hashlib.sha1(smart_bytes(email)).digest()).rstrip(
        b"="
    )