summaryrefslogtreecommitdiff
path: root/ext/digest/rmd160
diff options
context:
space:
mode:
authorhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-20 07:57:30 +0000
committerhsbt <hsbt@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-10-20 07:57:30 +0000
commit814c1adec7d20b74b9499cb2c1b37e12b1b04681 (patch)
tree4953f1fd770b9b48945be09fa3cf808ed435d6e7 /ext/digest/rmd160
parentd74bb0958d0af93496f7ac030f134f9164518e30 (diff)
* ext/digest/digest.c: Add documentation for Digest.
[Feature #10452][ruby-core:66001][ci skip] * remove HMAC from list of digest algorithms, * add MD5 in list of digest algorithms, * add information about writing a C digest implementation using Digest::Base, * add documentation for Digest::Base public methods. * ext/digest/md5/md5init.c: add examples for MD5. * ext/digest/rmd160/rmd160init.c: add examples for Digest::RMD160. * ext/digest/sha1/sha1init.c: add examples for Digest::SHA1. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/rmd160')
-rw-r--r--ext/digest/rmd160/rmd160init.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/ext/digest/rmd160/rmd160init.c b/ext/digest/rmd160/rmd160init.c
index c1e753cc11c..fbd6d5a9385 100644
--- a/ext/digest/rmd160/rmd160init.c
+++ b/ext/digest/rmd160/rmd160init.c
@@ -20,9 +20,29 @@ static const rb_digest_metadata_t rmd160 = {
};
/*
+ * Document-class: Digest::RMD160 < Digest::Base
* A class for calculating message digests using RIPEMD-160
* cryptographic hash function, designed by Hans Dobbertin, Antoon
* Bosselaers, and Bart Preneel.
+ *
+ * RMD160 calculates a digest of 160 bits (20 bytes).
+ *
+ * == Examples
+ * require 'digest'
+ *
+ * # Compute a complete digest
+ * Digest::RMD160.hexdigest 'abc' #=> "8eb208f7..."
+ *
+ * # Compute digest by chunks
+ * rmd160 = Digest::RMD160.new # =>#<Digest::RMD160>
+ * rmd160.update "ab"
+ * rmd160 << "c" # alias for #update
+ * rmd160.hexdigest # => "8eb208f7..."
+ *
+ * # Use the same object to compute another digest
+ * rmd160.reset
+ * rmd160 << "message"
+ * rmd160.hexdigest # => "1dddbe1b..."
*/
void
Init_rmd160(void)