def get_algorithm(algorithm):
 global _hashes
 if (_hashes is None):
  _setup_hashes()
 if isinstance(algorithm, (str, unicode)):
  algorithm = dns.name.from_text(algorithm)
 if ((sys.hexversion < 33882624) and ((algorithm == HMAC_SHA384) or (algorithm == HMAC_SHA512))):
  raise NotImplementedError((('TSIG algorithm ' + str(algorithm)) + ' requires Python 2.5.2 or later'))
 try:
  return (algorithm.to_digestable(), _hashes[algorithm])
 except KeyError:
  raise NotImplementedError((('TSIG algorithm ' + str(algorithm)) + ' is not supported'))

def get_algorithm ( algorithm ) : global _hashes if ( _hashes is None ) : _setup_hashes ( ) if isinstance ( algorithm , ( str , unicode ) ) : algorithm = dns . name . from_text ( algorithm ) if ( ( sys . hexversion < 33882624 ) and ( ( algorithm == HMAC_SHA384 ) or ( algorithm == HMAC_SHA512 ) ) ) : raise NotImplementedError ( ( ( 'TSIG algorithm ' + str ( algorithm ) ) + ' requires Python 2.5.2 or later' ) ) try : return ( algorithm . to_digestable ( ) , _hashes [ algorithm ] ) except KeyError : raise NotImplementedError ( ( ( 'TSIG algorithm ' + str ( algorithm ) ) + ' is not supported' ) )
returns the wire format string and the hash module to use for the specified tsig algorithm @rtype: @raises notimplementederror: i{algorithm} is not supported .