def cookie_encode(data, key):
    msg = base64.b64encode(pickle.dumps(data, -1))
    sig = base64.b64encode(hmac.new(tob(key), msg).digest())
    return tob('!') + sig + tob('?') + msg
Encode and sign a pickle-able object. Return a (byte) string
dataset/ETHPy150Open Arelle/Arelle/arelle/webserver/bottle.py/cookie_encode