1 # 首先调用函数hashlib 2 import hashlib 3 # 再造一个密码出来 4 password = 'woshimima' 5 # 用sha256对password进行加密 6 hash_password = hashlib.sha256(password.encode("utf-8")).hexdigest() 7 # 输出对应的哈希值 8 print(hash_password)