parameters: (key, msg, digest)
return_statement: return outer.digest()
docstring: Fast inline implementation of HMAC
  
      key:    key for the keyed hash object.
      msg:    input message
      digest: A hash name suitable for hashlib.new() for best performance. *OR*
              A hashlib constructor returning a new hash object. *OR*
              A module supporting PEP 247.
  
      Note: key and msg must be a bytes or bytearray objects.
docstring_summary: Fast inline implementation of HMAC
docstring_tokens: Fast inline implementation of HMAC
function: def digest(key, msg, digest):
      """Fast inline implementation of HMAC
  
      key:    key for the keyed hash object.
      msg:    input message
      digest: A hash name suitable for hashlib.new() for best performance. *OR*
              A hashlib constructor returning a new hash object. *OR*
              A module supporting PEP 247.
  
      Note: key and msg must be a bytes or bytearray objects.
      """
      if (_hashopenssl is not None and
              isinstance(digest, str) and digest in _openssl_md_meths):
          return _hashopenssl.hmac_digest(key, msg, digest)
  
      if callable(digest):
          digest_cons = digest
      elif isinstance(digest, str):
          digest_cons = lambda d=b'': _hashlib.new(digest, d)
      else:
          digest_cons = lambda d=b'': digest.new(d)
  
      inner = digest_cons()
      outer = digest_cons()
      blocksize = getattr(inner, 'block_size', 64)
      if len(key) > blocksize:
          key = digest_cons(key).digest()
      key = key + b'\x00' * (blocksize - len(key))
      inner.update(key.translate(trans_36))
      outer.update(key.translate(trans_5C))
      inner.update(msg)
      outer.update(inner.digest())
      return outer.digest()
function_tokens: def digest ( key , msg , digest ) : if ( _hashopenssl is not None and isinstance ( digest , str ) and digest in _openssl_md_meths ) : return _hashopenssl . hmac_digest ( key , msg , digest ) if callable ( digest ) : digest_cons = digest elif isinstance ( digest , str ) : digest_cons = lambda d = b'' : _hashlib . new ( digest , d ) else : digest_cons = lambda d = b'' : digest . new ( d ) inner = digest_cons ( ) outer = digest_cons ( ) blocksize = getattr ( inner , 'block_size' , 64 ) if len ( key ) > blocksize : key = digest_cons ( key ) . digest ( ) key = key + b'\x00' * ( blocksize - len ( key ) ) inner . update ( key . translate ( trans_36 ) ) outer . update ( key . translate ( trans_5C ) ) inner . update ( msg ) outer . update ( inner . digest ( ) ) return outer . digest ( )