bcrypt.checkpw returns TypeError: Unicode-objects must be encoded before checking

前端 未结 4 1847
有刺的猬
有刺的猬 2021-02-05 05:39

I am calling bcrypt.checkpw to check unencrypted password matches with hashed password stored in the credential database, but receive

TypeEr

4条回答
  •  既然无缘
    2021-02-05 06:09

    Something you could do like this

    bcrypt.checkpw(password.encode('utf-8'), hashed_password.encode('utf-8'))
    

    simple does it

提交回复
热议问题