def get_hasher(algorithm=u'default'):
 if hasattr(algorithm, u'algorithm'):
  return algorithm
 elif (algorithm == u'default'):
  if (PREFERRED_HASHER is None):
   load_hashers()
  return PREFERRED_HASHER
 else:
  if (HASHERS is None):
   load_hashers()
  if (algorithm not in HASHERS):
   raise ValueError((u"Unknown password hashing algorithm '%s'. Did you specify it in the PASSWORD_HASHERS setting?" % algorithm))
  return HASHERS[algorithm]

def get_hasher ( algorithm = u'default' ) : if hasattr ( algorithm , u'algorithm' ) : return algorithm elif ( algorithm == u'default' ) : if ( PREFERRED_HASHER is None ) : load_hashers ( ) return PREFERRED_HASHER else : if ( HASHERS is None ) : load_hashers ( ) if ( algorithm not in HASHERS ) : raise ValueError ( ( u"Unknown password hashing algorithm '%s'. Did you specify it in the PASSWORD_HASHERS setting?" % algorithm ) ) return HASHERS [ algorithm ]
returns an instance of a loaded password hasher .