嗨,我对此有点新,无法准确找出如何使其工作。将输入(密码)转换为MD5
这里是我当前的代码:
import hashlib
def PasswordCreate():
password = input(str("Please enter a password next to this text"))
password = hashlib.md5()
password.update(password.encode('utf-8'))
return password.hexdigest()
PasswordCreate()
的错误是:
AttributeError: '_hashlib.HASH' object has no attribute 'encode'
那么,什么是你的_exact_问题? – yeputons
@yeputons代码不起作用,我将编辑并把问题的错误 – Josh