在多次搜索之后,我无法确定如何避免错误说明:"使用此代码时,必须在散列之前对Unicode对象进行编码":
pwdinput = input("Now enter a password:") pwd = hashlib.sha1() pwd.update(pwdinput) pwd = pwd.hexdigest()
我怎样才能克服这个错误?你如何编码Unicode对象?
python unicode hashlib
hashlib ×1
python ×1
unicode ×1