import hashlib


def passgen(mxid, passgen_secret):
    """Function for translating a mxid into a known-but-unguessable password."""
    return hashlib.sha256(mxid + '\x00' + passgen_secret).hexdigest()