vendor/bundle/ruby/2.1.0/gems/httpauth-0.2.1/lib/httpauth/digest.rb
# Calculate the digest value for the directives as explained in the RFC.
#
# * <tt>variant</tt>: Either <tt>:request</tt> or <tt>:response</tt>, as seen from the server.
Calculate the digest value for the directives as explained in the RFC.
variant: Either :request or :response, as seen from the server.
Calculate the digest value for the directives as explained in the RFC . variant : Either : request or : response as seen from the server .
def calculate_digest(h, s, variant)
          fail(ArgumentError, "Variant should be either :request or :response, not #{variant}") unless [:request, :response].include?(variant)
          if h[:qop].nil?
            digest_kd digest_a1(h, s), digest_concat(
              h[:nonce],
              send("#{variant}_digest_a2".intern, h)
            )
          else
            digest_kd digest_a1(h, s), digest_concat(
              h[:nonce],
              Conversions.int_to_hex(h[:nc]),
              h[:cnonce],
              h[:qop],
              send("#{variant}_digest_a2".intern, h)
            )
          end
        end
def calculate_digest ( h , s , variant ) fail ( ArgumentError , "Variant should be either :request or :response, not #{variant}" ) unless [ :request , :response ] . include? ( variant ) if h [ :qop ] . nil? digest_kd digest_a1 ( h , s ) , digest_concat ( h [ :nonce ] , send ( "#{variant}_digest_a2" . intern , h ) ) else digest_kd digest_a1 ( h , s ) , digest_concat ( h [ :nonce ] , Conversions . int_to_hex ( h [ :nc ] ) , h [ :cnonce ] , h [ :qop ] , send ( "#{variant}_digest_a2" . intern , h ) ) end end
Calculate the digest value for the directives as explained in the RFC.
Calculate the digest value for the directives as explained in the RFC .
# Compatability with RFC 2069
h
s
variant