def HA1(realm, username, password, algorithm):
if not realm:<EOL><INDENT>realm = u'<STR_LIT>'<EOL><DEDENT>return H(b"<STR_LIT::>".join([username.encode('<STR_LIT:utf-8>'),<EOL>realm.encode('<STR_LIT:utf-8>'),<EOL>password.encode('<STR_LIT:utf-8>')]), algorithm)<EOL>
Create HA1 hash by realm, username, password

    HA1 = md5(A1) = MD5(username:realm:password)