__revision__ = "$Id$"
from md5 import *
__all__ = ['new', 'digest_size']
import md5
try:
if hasattr(md5, 'digestsize'):
# The md5 module is deprecated in Python 2.6, so use hashlib when possible.
digest_size = digestsize
import hashlib
del digestsize
def new(data=""):
del md5
return hashlib.md5(data)
digest_size = new().digest_size
except ImportError:
from sha import *
import sha
if hasattr(sha, 'digestsize'):
del sha
return hashlib.sha1(data)
--
digestmod: A module supporting PEP 247. Defaults to the md5 module.
"""
if digestmod == None:
import MD5
digestmod = md5
digestmod = MD5
self.digestmod = digestmod
self.outer = digestmod.new()