[前][次][番号順一覧][スレッド一覧]

ruby-changes:20903

From: drbrain <ko1@a...>
Date: Sat, 13 Aug 2011 02:28:00 +0900 (JST)
Subject: [ruby-changes:20903] drbrain:r32951 (ruby_1_9_3): * Backport r32950 from trunk.

drbrain	2011-08-13 02:26:00 +0900 (Sat, 13 Aug 2011)

  New Revision: 32951

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32951

  Log:
    * Backport r32950 from trunk.
    
    * ext/digest/digest.c:  Add documentation for the Digest module.  Patch by
      Sylvain Daubert.  [Ruby 1.9 - Bug #5167]

  Modified files:
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/ext/digest/digest.c

Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32950)
+++ ruby_1_9_3/ChangeLog	(revision 32951)
@@ -1,3 +1,10 @@
+Sat Aug 13 02:19:57 2011  Eric Hodel  <drbrain@s...>
+
+	* backport r32950 from trunk.
+
+	* ext/digest/digest.c:  Add documentation for the Digest module.  Patch
+	  by Sylvain Daubert.  [Ruby 1.9 - Bug #5167]
+
 Fri Aug  5 13:32:43 2011  Shugo Maeda  <shugo@r...>
 
 	* backport r32856 from trunk.
Index: ruby_1_9_3/ext/digest/digest.c
===================================================================
--- ruby_1_9_3/ext/digest/digest.c	(revision 32950)
+++ ruby_1_9_3/ext/digest/digest.c	(revision 32951)
@@ -29,6 +29,53 @@
  * Document-module: Digest
  *
  * This module provides a framework for message digest libraries.
+ *
+ * You may want to look at OpenSSL::Digest as it supports support more
+ * algorithms.
+ *
+ * A cryptographic hash function is a procedure that takes data and return a
+ * fixed bit string : the hash value, also known as _digest_. Hash functions
+ * are also called one-way functions, it is easy to compute a digest from
+ * a message, but it is infeasible to generate a message from a digest.
+ *
+ * == Example
+ *
+ *   require 'digest'
+ *
+ *   # Compute a complete digest
+ *   sha256 = Digest::SHA256.new
+ *   digest = sha256.digest message
+ *
+ *   # Compute digest by chunks
+ *   sha256 = Digest::SHA256.new
+ *   sha256.update message1
+ *   sha256 << message2 # << is an alias for update
+ *
+ *   digest = sha256.digest
+ *
+ * == Digest algorithms
+ *
+ * Different digest algorithms (or hash functions) are available :
+ *
+ * HMAC::
+ *   See FIPS PUB 198 The Keyed-Hash Message Authentication Code (HMAC)
+ * RIPEMD-160::
+ *   (as Digest::RMD160) see
+ *   http://homes.esat.kuleuven.be/~bosselae/ripemd160.html
+ * SHA1::
+ *   See FIPS 180 Secure Hash Standard
+ * SHA2 family::
+ *   See FIPS 180 Secure Hash Standard which defines the following algorithms:
+ *   * SHA512
+ *   * SHA384
+ *   * SHA256
+ *
+ * The latest versions of the FIPS publications can be found here:
+ * http://csrc.nist.gov/publications/PubsFIPS.html
+ *
+ * Additionally Digest::BubbleBabble encodes a digest as a sequence of
+ * consonants and vowels which is more recognizable and comparable than a
+ * hexadecimal digest.  See http://en.wikipedia.org/wiki/Bubblebabble
  */
 
 static VALUE

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]