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 [+]



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'
    lib = File.join('digest', name.to_s.downcase)

    require lib
  rescue LoadError => e
    raise LoadError, "library not found for class Digest::#{name} -- #{lib}", caller(1)
  unless Digest.const_defined?(name)
    raise NameError, "uninitialized constant Digest::#{name}", caller(1)
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.