hash_1_9.py 270 B

123456789
  1. def md5_generic_passwd(password, uppercase=False):
  2. """
  3. >>> md5_generic_passwd(password='testpass', uppercase=False)
  4. '179ad45c6ce2cb97cf1029e212046e81'
  5. """
  6. retVal = md5(password).hexdigest()
  7. return retVal.upper() if uppercase else retVal.lower()