pycharm回车符问题
如何判断类是类

TypeError: Unicode-objects must be encoded before hashing

妙音 posted @ 2018年6月29日 07:16 in python with tags python3 , 796 阅读

python3中md5加密报错

>>> import hashlib
>>> md5 = hashlib.md5()
>>> md5.update("123")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Unicode-objects must be encoded before hashing

正确方式

unicode对象不能直接加密

md5.update("123".encode("utf-8"))
 
《寿康宝鉴》有声书
寿康宝鉴百话有声书(mp3)

 

Avatar_small
Charlie 说:
2018年10月22日 20:15

Type error handling is easy for users with take help from here that deliver valid solution for this purpose. People get quick reviews from custompapers.com reviews here and get professional writing help for their works.


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter