From 744c70546df6f7cbcec676772d67650d221f679e Mon Sep 17 00:00:00 2001 From: Q37ek6wrm <1641520215@qq.com> Date: Fri, 16 Dec 2022 20:25:53 +0800 Subject: [PATCH] ADD file via upload --- hashalg.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 hashalg.py diff --git a/hashalg.py b/hashalg.py new file mode 100644 index 0000000..11fb603 --- /dev/null +++ b/hashalg.py @@ -0,0 +1,11 @@ +import hashlib +#hash函数 +def hash_sha256(datas): #sha256 哈希函数 + x=hashlib.sha256() + x.update(datas) + s=x.hexdigest() + return s + +if __name__ == '__main__': + e=hash_sha256('你好'.encode('utf-8')) + print(e) \ No newline at end of file