How to reuse an instance of hashlib.md5
Here's what I did, just write a little wrapper that reinitializes the hash object. Handles the clunkiness of the code writing, but maybe not the efficiency at runtime.
def Hasher(object): def __init__(self): self.md5 = hashlib.md5() def get_hash(self, o): self.md5.update(o) my_hash = self.md5.digest() self.md5 = hashlib.md5() return my_hash