hash_1_13.py 375 B

123456789
  1. def sha512_generic_passwd(password, uppercase=False):
  2. """
  3. >>> sha512_generic_passwd(password='testpass', uppercase=False)
  4. '78ddc8555bb1677ff5af75ba5fc02cb30bb592b0610277ae15055e189b77fe3fda496e5027a3d99ec85d54941adee1cc174b50438fdc21d82d0a79f85b58cf44'
  5. """
  6. retVal = sha512(password).hexdigest()
  7. return retVal.upper() if uppercase else retVal.lower()