I want to serialize/deserialize md5 context. But I don\'t know how to do it in Python. Pseudocode of what I want to do.
import md5
# Start hash generation
m
HASH objects are not serializable: How to serialize hash objects in Python
Assuming you can pass around the unhashed data:
from Crypto.Hash import MD5
# generate hash
m = MD5.new()
s = "foo"
m.update(s)
# serialize m
serialized = s
# deserialize and continue hash generation
m2 = MD5.new(serialized)
if m2.hexdigest() == m.hexdigest():
print "success"
m2.update("bar")