hash_1_10.py 281 B

123456789
  1. def sha1_generic_passwd(password, uppercase=False):
  2. """
  3. >>> sha1_generic_passwd(password='testpass', uppercase=False)
  4. '206c80413b9a96c1312cc346b7d2517b84463edd'
  5. """
  6. retVal = sha1(password).hexdigest()
  7. return retVal.upper() if uppercase else retVal.lower()