Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
OpenSSL::HMAC#==
==(other)
ext/openssl/lib/openssl/hmac.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.3.0/ext/openssl/lib/openssl/hmac.rb, line 6
def ==(other)
return false unless HMAC === other
return false unless self.digest.bytesize == other.digest.bytesize
OpenSSL.fixed_length_secure_compare(self.digest, other.digest)
end
Securely compare with another HMAC instance in constant time.