python添加MD5加密
#!/usr/bin/env python
# -*-coding:utf-8-*-
# author:BeeLu
import hashlib
# params = "name=jjjjjj&access_token=2FBFRSTvkbJd3ZthPzAh0oZcPBhC16Qi"
params = ""
access_token='******'
data = {
}
for i in data:
params += i + "=" + data[i] + '&' # 循环取data的数据并&连接起来
params = params + "access_token=" + access_token
key_sign = hashlib.md5(params.encode(encoding="utf-8")).hexdigest() # md5加密,有中文要改变encode
print(key_sign)