diff options
author | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-25 08:54:05 +0000 |
---|---|---|
committer | knu <knu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-10-25 08:54:05 +0000 |
commit | 817afbd987d35e4d65f599270f3b42777698556f (patch) | |
tree | 05c2adf01a163a7014589d6479cf1e4a1ac9198f /ext/digest/digest.txt | |
parent | 0bdf887afc78fb049295d78a9018701da094b8c3 (diff) |
* ext/digest, test/digest/test_digest.rb: Merge from trunk:
- Introduce versioning in Digest::Base API, and prefix C
constants with RUBY_ and C type names with rb_ to avoid name
clash in writing extensions.
- Introduce Digest::Class and Digest::Instance for ease of
implementing subclasses and add-ons.
- Digest::Instance module requires and assumes that any instance
be resettable and clonable. An instance method #new() is
added so digest instances work just like digest classes.
- The constructor does no longer take an initial string to feed;
digest() and hexdigest() now do, instead. This allows digest
classes to take their own hashing parameters.
- Make some changes to digest() and hexdigest() class methods,
which now take extra arguments, which are passed through to
the constructor in an internal call.
- Add #digest_length/size/length() and #block_length(),
- Add the Digest::SHA2 class to wrap up SHA2 variants: SHA256,
SHA384 and SHA512, hoping this module would make a decent
example of a digest subclass written in Ruby.
- Rip BubbleBabble support out of the base class and have a
separate module named digest/bubblebabble.
- Remove RD documents in favor of newly written and embedded
RDoc documentation.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@11223 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/digest/digest.txt')
-rw-r--r-- | ext/digest/digest.txt | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/ext/digest/digest.txt b/ext/digest/digest.txt deleted file mode 100644 index 5797dd18f9..0000000000 --- a/ext/digest/digest.txt +++ /dev/null @@ -1,113 +0,0 @@ -.\" digest.txt - -*- Indented-Text -*- created at: Fri May 25 08:13:50 JST 2001 -$RoughId: digest.txt,v 1.9 2001/07/13 19:46:51 knu Exp $ -$Id$ - -** MD5(Class) - -A class to implement the MD5 Message-Digest Algorithm by RSA Data -Security, Inc., described in RFC1321. - -Superclass: Digest::Base - -require 'digest/md5' - -** SHA1(Class) - -A class to implement the SHA-1 Secure Hash Algorithm by NIST (the US' -National Institute of Standards and Technology), described in FIPS PUB -180-1. - -Superclass: Digest::Base - -require 'digest/sha1' - -** SHA256(Class) -** SHA384(Class) -** SHA512(Class) - -Classes to implement the SHA-256/384/512 Secure Hash Algorithm(s) by -NIST (the US' National Institute of Standards and Technology), -described in FIPS PUB 180-2. - -Superclass: Digest::Base - -require 'digest/sha2' - -** RMD160(Class) - -A class to implement the RIPEMD-160 cryptographic hash function, -designed by Hans Dobbertin, Antoon Bosselaers, and Bart Preneel. - -Superclass: Digest::Base - -require 'digest/rmd160' - - -Those above classes provide a common interface as shown below. - - -Class Methods: - - new([str]) - - Creates a new digest object. If a string argument is given, - it is added to the object. (see update.) - - digest(str) - - Immediately calculates and return the hash of the given - strings as a string. Equivalent to new(str).digest. - - hexdigest(str) - - Immediately calculates and return the hash of the given - strings as a string of hexadecimal digits. Equivalent to - new(str).hexdigest. - -Methods: - - clone - - Creates a copy of the digest object. - - digest - - Returns the hash of the added strings as a string of 16 bytes - for MD5, 20 bytes for SHA1 and RMD160, 32 bytes for SHA256, 48 - bytes for SHA384, and 64 bytes for SHA512. - - hexdigest - to_s - - Returns the hash of the added strings as a string of 32 - hexadecimal digits for MD5, 40 hexadecimal digits for SHA1 and - RMD160, 64 hexadecimal digits for SHA256, 96 hexadecimal - digits for SHA384, and 128 hexadecimal digits for SHA512. - This method is equal to: - - def hexdigest - digest.unpack("H*")[0] - end - - update(str) - << str - - Appends the string str to the digest object. Repeated calls - are equivalent to a single call with the concatenation of all - the arguments, i.e. m.update(a); m.update(b) is equivalent to - m.update(a + b) and m << a << b is equivalent to m << a + b. - - == md - - Checks if the object is equal to the given digest object. - - == str - - Regards the value as either a digest value or a hexdigest - value (depending on the length) and checks if the object is - equal to the given string. - -------------------------------------------------------- -Local variables: -fill-column: 70 -end: |