Extended maintenance of Ruby versions 1.8.7 and 1.9.2 ended on July 31, 2014. Read more

In Files

  • digest/digest.c
  • digest/lib/digest.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);
}