golang hashedSecret too short to be a bcrypted password

Posted Time-Traveler

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了golang hashedSecret too short to be a bcrypted password相关的知识,希望对你有一定的参考价值。


记录一下这个疏忽造成的小问题:
具体错误:crypto/bcrypt: hashedSecret too short to be a bcrypted password

bcrypt.CompareHashAndPassword([]byte(u.PassWord), []byte(user.PassWord))

1.第一个参数是已经经过bcrypt.GenerateFromPassword处理的密码
2.第二个参数是请求提交的密码

确认代码无误后依旧提示 hashedSecret too short to be a bcrypted password,最终发现数据库给的长度太短,被截断了!!!

以上是关于golang hashedSecret too short to be a bcrypted password的主要内容,如果未能解决你的问题,请参考以下文章

too many open files linux服务器 golang java

IDEA 2021.3 执行 golang 报错:RNING: undefined behavior version of Delve is too old for Go version 1.18

IDEA 2021.3 执行 golang 报错:RNING: undefined behavior version of Delve is too old for Go version 1.18

GoLand调试报错:Version of Delve is too old for this version of Go...

python valueError:too many values unpack,有人知道么?

CEPH -S集群报错TOO MANY PGS PER OSD