parameters: (self, key, msg = None, digestmod = None)
docstring: Create a new HMAC object.
  
          key:       key for the keyed hash object.
          msg:       Initial input for the hash, if provided.
          digestmod: A module supporting PEP 247. Defaults to the md5 module.
docstring_summary: Create a new HMAC object.
docstring_tokens: Create a new HMAC object .
function: def __init__(self, key, msg = None, digestmod = None):
          """Create a new HMAC object.
  
          key:       key for the keyed hash object.
          msg:       Initial input for the hash, if provided.
          digestmod: A module supporting PEP 247. Defaults to the md5 module.
          """
          if digestmod == None:
              import md5
              digestmod = md5
  
          self.digestmod = digestmod
          self.outer = digestmod.new()
          self.inner = digestmod.new()
          try:
              self.digest_size = digestmod.digest_size
          except AttributeError:
              self.digest_size = len(self.outer.digest())
  
          blocksize = 64
          ipad = "\x36" * blocksize
          opad = "\x5C" * blocksize
  
          if len(key) > blocksize:
              key = digestmod.new(key).digest()
  
          key = key + chr(0) * (blocksize - len(key))
          self.outer.update(_strxor(key, opad))
          self.inner.update(_strxor(key, ipad))
          if (msg):
              self.update(msg)
function_tokens: def __init__ ( self , key , msg = None , digestmod = None ) : if digestmod == None : import md5 digestmod = md5 self . digestmod = digestmod self . outer = digestmod . new ( ) self . inner = digestmod . new ( ) try : self . digest_size = digestmod . digest_size except AttributeError : self . digest_size = len ( self . outer . digest ( ) ) blocksize = 64 ipad = "\x36" * blocksize opad = "\x5C" * blocksize if len ( key ) > blocksize : key = digestmod . new ( key ) . digest ( ) key = key + chr ( 0 ) * ( blocksize - len ( key ) ) self . outer . update ( _strxor ( key , opad ) ) self . inner . update ( _strxor ( key , ipad ) ) if ( msg ) : self . update ( msg )