#!/usr/bin/python3 import hashlib def get_md5(data): obj = hashlib.md5() obj.update(data.encode('utf-8')) result = obj.hexdigest() return result def get_SHA1(data): obj2 = hashlib.sha1() obj2.update(data.encode('utf-8')) result2 = obj2.hexdigest() return result2 while True: s=input("输入你要的文字的哈希值") val = get_md5(str(s)) print("MD5",val) val = get_SHA1(str(s)) print("SHA1",val)
2020-11-20
最新推荐文章于 2023-01-05 15:25:20 发布