设计密码加密
Devise password encryption
嘿,我在我的应用程序中使用 Rails,但现在我正在迁移到 ReactJs + Node。
我无法发现 Devise 如何加密密码,以便我可以将请求从前端发送到后端。
我正在为我的数据库使用 Postgres。
Devise 正在使用 bcrypt
gem 进行加密(https://github.com/codahale/bcrypt-ruby), you can also look at how Devise is doing it here: https://github.com/plataformatec/devise/blob/f39c6fd92774cb66f96f546d8d5e8281542b4e78/lib/devise/encryptor.rb
更详细的算法可以看这里:https://github.com/codahale/bcrypt-ruby/blob/master/lib/bcrypt/password.rb
希望对您有所帮助
嘿,我在我的应用程序中使用 Rails,但现在我正在迁移到 ReactJs + Node。
我无法发现 Devise 如何加密密码,以便我可以将请求从前端发送到后端。
我正在为我的数据库使用 Postgres。
Devise 正在使用 bcrypt
gem 进行加密(https://github.com/codahale/bcrypt-ruby), you can also look at how Devise is doing it here: https://github.com/plataformatec/devise/blob/f39c6fd92774cb66f96f546d8d5e8281542b4e78/lib/devise/encryptor.rb
更详细的算法可以看这里:https://github.com/codahale/bcrypt-ruby/blob/master/lib/bcrypt/password.rb
希望对您有所帮助