简体   繁体   English

Postgres修改我的bcrypt哈希,如何使其停止?

[英]Postgres modifying my bcrypt hash, how to make it stop?

I am hashing my password with bcrypt and trying to store it in Postgres. 我正在用bcrypt哈希密码,并尝试将其存储在Postgres中。 I don't want to use the native function because I don't want to program any logic like that in Postgres. 我不想使用本机函数,因为我不想在Postgres中编写任何类似的逻辑。

Is there someway to escape it or is using the 'text' type not right? 是否有某种办法可以逃脱它,或者使用的是'text'类型不正确?

You can simply store the encrypted password in the database as a plain string. 您可以简单地将加密密码作为纯字符串存储在数据库中。 There is no need to use the PostgreSQL functions for encryption. 无需使用PostgreSQL函数进行加密。 The string should be small enough that you don't need to use a text datatype, a varchar would be sufficient. 该字符串应该足够小,以至于您不需要使用text数据类型,而使用varchar就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM