Permalink
Browse files

Enable .update() after .digest() or .hexdigest().

  • Loading branch information...
1 parent 078ea9f commit 9ba400a09d84e4e1c771ec79ccf61ea28973c340 @hinnerk hinnerk committed May 30, 2012
Showing with 2 additions and 5 deletions.
  1. +2 −5 convergent/crypto.py
View
7 convergent/crypto.py
@@ -145,11 +145,8 @@ def update(self, data):
self.h.update(data)
def digest(self):
- if not hasattr(self,"_digest"):
- self._digest = sha256(self.h.digest()).digest()[:self.truncate_to]
- del self.h
- return self._digest
-
+ return sha256(self.h.digest()).digest()[:self.truncate_to]
+
def hexdigest(self):
return self.digest().encode('hex')

0 comments on commit 9ba400a

Please sign in to comment.