安装hashlib pip install hashlib
import hashlib
scrkey =’7F5F85D889B48DE7F83BFDA74CBAB670’
params={
“email”: email,
“password”: pwd,
“cfmpwd”: pwd,
“ecode”: code
}
def buildMySign(params, scrkey):
”’获取加密”’
sign = ”
for key in sorted(params.keys()):
sign += key + ‘=’ + str(params[key]) + ‘&’
data = sign + ‘secret_key=’ + scrkey
return hashlib.md5(data.encode(“utf8”)).hexdigest().upper()