发布时间:2019-09-27 07:09:51编辑:auto阅读(2064)
import hashlib
def _verfy_ac(private_key, params):
items = sorted(params.items(), key=lambda x: x[0])
params_data = ""
for i in items:
params_data = params_data + i[0] + i[1]
params_data = params_data + private_key
sign = hashlib.sha1()
sign.update(params_data.encode("utf8"))
signature = sign.hexdigest()
return signature
s = _verfy_ac("私钥", {
"Action": "DescribeImage",
"PublicKey": "公钥",
"OsType": "Linux",
"Region": "cn-bj2"
})
print(s)
上一篇: linux 安装python3
下一篇: python3监控网站状态
47750
46246
37132
34638
29231
25893
24762
19866
19426
17916
5720°
6323°
5841°
5891°
6991°
5830°
5850°
6364°
6318°
7682°