def digest_password(realm, username, password):
 content = ('%s:%s:%s' % (username, realm, password))
 if six.PY3:
  content = content.encode('utf8')
 return md5(content).hexdigest()

def digest_password ( realm , username , password ) : content = ( '%s:%s:%s' % ( username , realm , password ) ) if six . PY3 : content = content . encode ( 'utf8' ) return md5 ( content ) . hexdigest ( )
construct the appropriate hashcode needed for http digest .