md5加密

import requests

import hashlib


#测试文件上传

files = {'file':('touxiang.png',open('c:/touxiang.png','rb'))}

res = requests.post('http://localhost:8000/upload/',files=files)


print(res.text)


#md5加密
def make_password(mypass):

	#生成对象
	md5 = hashlib.md5()
	#定义加密对象
	sign_str = mypass
	#转码
	sign_utf8 = str(sign_str).encode(encoding="utf-8")
	#加密
	md5.update(sign_utf8)
	#生成密文
	md5_server = md5.hexdigest()

	return md5_server

posted @ 2022-12-23 09:05  乐乐乐乐乐乐樂  阅读(19)  评论(0)    收藏  举报
jQuery火箭图标返回顶部代码