mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 12:57:29 +08:00
Use Xorcist.xor! instead of refinements since Ruby 3.2+ removes Refinment-include (#15694)
This commit is contained in:
parent
7d5d2bf13e
commit
c666094380
|
@ -5,11 +5,8 @@
|
|||
|
||||
require 'openssl'
|
||||
require 'xorcist'
|
||||
require 'xorcist/refinements'
|
||||
|
||||
class Pbkdf2
|
||||
using Xorcist::Refinements
|
||||
|
||||
def self.hash_password(password, salt, iterations, algorithm = "sha256")
|
||||
|
||||
h = OpenSSL::Digest.new(algorithm)
|
||||
|
@ -18,7 +15,7 @@ class Pbkdf2
|
|||
|
||||
2.upto(iterations) do
|
||||
u = prf(h, password, u)
|
||||
ret.xor!(u)
|
||||
Xorcist.xor!(ret, u)
|
||||
end
|
||||
|
||||
ret.bytes.map { |b| ("0" + b.to_s(16))[-2..-1] }.join("")
|
||||
|
|
Loading…
Reference in New Issue
Block a user