python字符串MD5加密

import hashlib

string = 'userId=669&apikey=098f6bcd4621d373cade4e832627b4f6&times='

def md5value(key):
input_name = hashlib.md5()
input_name.update(key.encode("utf-8"))
print("大写的32位" + (input_name.hexdigest()).upper())
print("大写的16位"+(input_name.hexdigest())[8:-8].upper())
print("小写的32位" + (input_name.hexdigest()).lower())
print("小写的16位" + (input_name.hexdigest())[8:-8].lower())


md5value(string)

 

 

 

转发:https://blog.csdn.net/li561999181/article/details/109716232

posted @ 2021-09-26 13:44  快乐的平头哥  阅读(801)  评论(0编辑  收藏  举报