summaryrefslogtreecommitdiff
path: root/ext/digest/md5/md5init.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/digest/md5/md5init.c')
-rw-r--r--ext/digest/md5/md5init.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/digest/md5/md5init.c b/ext/digest/md5/md5init.c
index a6afede..41f966fa 100644
--- a/ext/digest/md5/md5init.c
+++ b/ext/digest/md5/md5init.c
@@ -22,9 +22,29 @@ static const rb_digest_metadata_t md5 = {
};
/*
+ * Document-class: Digest::MD5 < Digest::Base
* A class for calculating message digests using the MD5
* Message-Digest Algorithm by RSA Data Security, Inc., described in
* RFC1321.
+ *
+ * MD5 calculates a digest of 128 bits (16 bytes).
+ *
+ * == Examples
+ * require 'digest'
+ *
+ * # Compute a complete digest
+ * Digest::MD5.hexdigest 'abc' #=> "90015098..."
+ *
+ * # Compute digest by chunks
+ * md5 = Digest::MD5.new # =>#<Digest::MD5>
+ * md5.update "ab"
+ * md5 << "c" # alias for #update
+ * md5.hexdigest # => "90015098..."
+ *
+ * # Use the same object to compute another digest
+ * md5.reset
+ * md5 << "message"
+ * md5.hexdigest # => "c13557f2..."
*/
void
Init_md5(void)