1.报错信息是:TypeError: Unicode-objects must be encoded before hashing

关于python的hashlib md5的报错处理

2.报错信息是:TypeError: object supporting the buffer API required

关于python的hashlib md5的报错处理

正确的写法应该是

关于python的hashlib md5的报错处理

代码:

import hashlib
def md5pwd(password):
m = hashlib.md5()
m.update(password)
mpwd = m.hexdigest()
return mpwd
print(md5pwd(b'123456'))

 

相关文章:

  • 2021-08-26
  • 2022-12-23
  • 2021-07-16
  • 2021-07-22
  • 2022-02-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
相关资源
相似解决方案