In Files

  • digest/digest.c
  • digest/lib/digest.rb
  • digest/lib/digest/hmac.rb
  • digest/sha2/lib/sha2.rb

Class/Module Index [+]

Quicksearch

Digest

This module provides a framework for message digest libraries.

Public Class Methods

const_missing(name) click to toggle source
 
               # File digest/lib/digest.rb, line 4
def self.const_missing(name)
  case name
  when :SHA256, :SHA384, :SHA512
    lib = 'digest/sha2.so'
  else
    lib = File.join('digest', name.to_s.downcase)
  end

  begin
    require lib
  rescue LoadError => e
    raise LoadError, "library not found for class Digest::#{name} -- #{lib}", caller(1)
  end
  unless Digest.const_defined?(name)
    raise NameError, "uninitialized constant Digest::#{name}", caller(1)
  end
  Digest.const_get(name)
end
            
hexencode(string) → hexencoded_string click to toggle source

Generates a hex-encoded version of a given string.

 
               static VALUE
rb_digest_s_hexencode(VALUE klass, VALUE str)
{
    return hexencode_str_new(str);
}
            

Commenting is here to help enhance the documentation. For example, code samples, or clarification of the documentation.

If you have questions about Ruby or the documentation, please post to one of the Ruby mailing lists. You will get better, faster, help that way.

If you wish to post a correction of the docs, please do so, but also file bug report so that it can be corrected for the next release. Thank you.

If you want to help improve the Ruby documentation, please visit Documenting-ruby.org.

blog comments powered by Disqus