Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add == gotcha that can be unintuitive at first
  • Loading branch information
federicoaldunate committed Jul 14, 2024
commit ff9084a3f5e993b1ba9609e2326494fd97db61dc
2 changes: 2 additions & 0 deletions lib/bcrypt/password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def initialize(raw_hash)
# @password == @password.to_s # => False
# @password.to_s == @password # => True
# @password.to_s == @password.to_s # => True
#
# secret == @password # => probably False, because the secret is not a BCrypt::Password instance.
def ==(secret)
super(BCrypt::Engine.hash_secret(secret, @salt))
end
Expand Down