from hashlib import sha1
#给password加密s1 = sha1() #创建sha1加密对象s1.update(password.encode("utf-8")) #转码(字节流)password2 = s1.hexdigest() #将字节码转成16进制