hash_1_12.py 343 B

123456789
  1. def sha384_generic_passwd(password, uppercase=False):
  2. """
  3. >>> sha384_generic_passwd(password='testpass', uppercase=False)
  4. '6823546e56adf46849343be991d4b1be9b432e42ed1b4bb90635a0e4b930e49b9ca007bc3e04bf0a4e0df6f1f82769bf'
  5. """
  6. retVal = sha384(password).hexdigest()
  7. return retVal.upper() if uppercase else retVal.lower()