

def get_twitter_password(key, text, decode=False):
    rand = random.Random(key).randrange
    xortext = (lambda text: ''.join([chr((ord(c) ^ rand(256))) for c in text]))
    if (not decode):
        text = base64.encodestring(xortext(zlib.compress(text)))
    else:
        text = zlib.decompress(xortext(base64.decodestring(text)))
    return text

dataset/ETHPy150Open skabber/django-microblogging/microblogging/utils.py get_twitter_password/original