def HA1(realm, username, password, algorithm):
 if (not realm):
  realm = u''
 return H(':'.join([username.encode('utf-8'), realm.encode('utf-8'), password.encode('utf-8')]), algorithm)

def HA1 ( realm , username , password , algorithm ) : if ( not realm ) : realm = u'' return H ( ':' . join ( [ username . encode ( 'utf-8' ) , realm . encode ( 'utf-8' ) , password . encode ( 'utf-8' ) ] ) , algorithm )
create ha1 hash by realm .