MCPcopy
hub / github.com/pyload/pyload / cookie_encode

Function cookie_encode

module/lib/bottle.py:1896–1900  ·  view source on GitHub ↗

Encode and sign a pickle-able object. Return a (byte) string

(data, key)

Source from the content-addressed store, hash-verified

1894
1895
1896def cookie_encode(data, key):
1897 ''' Encode and sign a pickle-able object. Return a (byte) string '''
1898 msg = base64.b64encode(pickle.dumps(data, -1))
1899 sig = base64.b64encode(hmac.new(tob(key), msg).digest())
1900 return tob('!') + sig + tob('?') + msg
1901
1902
1903def cookie_decode(data, key):

Callers 1

set_cookieMethod · 0.85

Calls 3

tobFunction · 0.85
digestMethod · 0.80
newMethod · 0.45

Tested by

no test coverage detected