# coding=utf8
from hashlib import sha1
def pwdUtl(pwd):
s1 = sha1()
s1.update(pwd.encode('utf-8'))
hpwd = s1.hexdigest()
return hpwd
本文介绍了一种使用SHA1算法进行密码加密的方法,通过Python代码示例详细展示了如何利用hashlib库实现密码的安全存储。
# coding=utf8
from hashlib import sha1
def pwdUtl(pwd):
s1 = sha1()
s1.update(pwd.encode('utf-8'))
hpwd = s1.hexdigest()
return hpwd
572
785

被折叠的 条评论
为什么被折叠?