python中sha1的加密

from hashlib import sha1
#给password加密
s1 = sha1() #创建sha1加密对象
s1.update(password.encode("utf-8")) #转码(字节流)
password2 = s1.hexdigest() #将字节码转成16进制
posted @ 2020-05-12 14:51  MR__Wang  阅读(5607)  评论(0编辑  收藏  举报