Skip to content

A platform for community discussion. Free, open, simple.

Use Xorcist.xor! instead of refinements since Ruby 3.2+ removes Refinment-include (#15694)

Noah Gibbsc6660943802f
diff --git a/lib/pbkdf2.rb b/lib/pbkdf2.rb
index 62551d052f4..933630fc1ba 100644
--- a/lib/pbkdf2.rb
+++ b/lib/pbkdf2.rb
@@ -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("")