$52 GRAYBYTE WORDPRESS FILE MANAGER $97

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 104.21.43.35 | ADMIN IP 216.73.216.157
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby30/share/ruby/openssl/

HOME
Current File : /opt/alt/ruby30/share/ruby/openssl//hmac.rb
# frozen_string_literal: true

module OpenSSL
  class HMAC
    # Securely compare with another HMAC instance in constant time.
    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

    class << self
      # :call-seq:
      #    HMAC.digest(digest, key, data) -> aString
      #
      # Returns the authentication code as a binary string. The _digest_ parameter
      # specifies the digest algorithm to use. This may be a String representing
      # the algorithm name or an instance of OpenSSL::Digest.
      #
      # === Example
      #  key = 'key'
      #  data = 'The quick brown fox jumps over the lazy dog'
      #
      #  hmac = OpenSSL::HMAC.digest('SHA1', key, data)
      #  #=> "\xDE|\x9B\x85\xB8\xB7\x8A\xA6\xBC\x8Az6\xF7\n\x90p\x1C\x9D\xB4\xD9"
      def digest(digest, key, data)
        hmac = new(key, digest)
        hmac << data
        hmac.digest
      end

      # :call-seq:
      #    HMAC.hexdigest(digest, key, data) -> aString
      #
      # Returns the authentication code as a hex-encoded string. The _digest_
      # parameter specifies the digest algorithm to use. This may be a String
      # representing the algorithm name or an instance of OpenSSL::Digest.
      #
      # === Example
      #  key = 'key'
      #  data = 'The quick brown fox jumps over the lazy dog'
      #
      #  hmac = OpenSSL::HMAC.hexdigest('SHA1', key, data)
      #  #=> "de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9"
      def hexdigest(digest, key, data)
        hmac = new(key, digest)
        hmac << data
        hmac.hexdigest
      end
    end
  end
end


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Jul 2024 8.44 AM
root / linksafe
0755
bn.rb
0.69 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
buffering.rb
10.054 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
cipher.rb
1.703 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
config.rb
12.939 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
digest.rb
1.632 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
hmac.rb
1.688 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
marshal.rb
0.555 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
pkcs5.rb
0.599 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
pkey.rb
14.107 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
ssl.rb
17.385 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
version.rb
0.068 KB
26 Jun 2024 1.55 PM
root / linksafe
0644
x509.rb
10.626 KB
26 Jun 2024 1.55 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF