Skip to content

Commit

Permalink
Create password_hasher.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Sep 20, 2024
1 parent 9aaa330 commit 05f5e29
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions global_business/business/lib/password_hasher.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
require 'bcrypt'

class PasswordHasher
def self.hash_password(password)
BCrypt::Password.create(password)
end

def self.verify_password(password, hashed_password)
BCrypt::Password.new(hashed_password) == password
end
end

0 comments on commit 05f5e29

Please sign in to comment.