diff options
Diffstat (limited to 'ext/digest/digest.txt.ja')
-rw-r--r-- | ext/digest/digest.txt.ja | 111 |
1 files changed, 111 insertions, 0 deletions
diff --git a/ext/digest/digest.txt.ja b/ext/digest/digest.txt.ja new file mode 100644 index 0000000000..8997d25b9d --- /dev/null +++ b/ext/digest/digest.txt.ja @@ -0,0 +1,111 @@ +.\" digest.txt.ja - -*- Indented-Text -*- created at: Fri May 25 08:22:19 JST 2001 +$RoughId: digest.txt.jp,v 1.8 2001/07/13 15:38:27 knu Exp $ +$Id$ + +** MD5(クラス) + +RFC1321に記述されているRSA Data Security, Inc. の MD5 Message-Digest +Algorithmを実装するクラス。 + +Superclass: Digest::Base + +require 'digest/md5' + +** SHA1(クラス) + +FIPS PUB 180-1に記述されているNIST (the US' National Institute of +Standards and Technology) の SHA-1 Secure Hash Algorithmを実装するクラス。 + +Superclass: Digest::Base + +require 'digest/sha1' + +** SHA256(クラス) +** SHA384(クラス) +** SHA512(クラス) + +FIPS PUB 180-2に記述されているNIST (the US' National Institute of +Standards and Technology) の SHA-256/384/512 Secure Hash Algorithmを +実装するクラス。 + +Superclass: Digest::Base + +require 'digest/sha2' + +** RMD160(クラス) + +Hans Dobbertin, Antoon Bosselaers, Bart Preneel によって設計された +RIPEMD-160 ハッシュ関数を実装するクラス。 + +Superclass: Digest::Base + +require 'digest/rmd160' + + +これらのクラスは以下のような共通のインターフェースを提供する。 + + +Class Methods: + + new([str]) + + 新しいダイジェストオブジェクトを生成する.文字列引数が与えられる + とそれを追加する(see update)。 + + digest(str) + + 与えられた文字列に対するハッシュ値を文字列で返す。 + new(str).digest と等価。 + + hexdigest(str) + + 与えられた文字列に対するハッシュ値を、ASCIIコードを使って + 16進数の列を示す文字列にエンコードして返す。 + new(str).hexdigest と等価。 + +Methods: + + clone + + ダイジェストオブジェクトの複製を作る。 + + digest + + 今までに追加した文字列に対するハッシュ値を文字列で返す。MD5では + 16バイト長、SHA1およびRMD160では20バイト長、SHA256では32バイト長、 + SHA384では48バイト長、SHA512では64バイト長となる。 + + hexdigest + to_s + + 今までに追加した文字列に対するハッシュ値を、ASCIIコードを使って + 16進数の列を示す文字列にエンコードして返す。MD5では32バイト長、 + SHA1およびRMD160では40バイト長、SHA256では64バイト長、SHA384では + 96バイト長、SHA512では128バイト長となる。Rubyで書くと以下と同じ。 + + def hexdigest + digest.unpack("H*")[0] + end + + update(str) + << str + + 文字列を追加する。複数回updateを呼ぶことは文字列を連結して + updateを呼ぶことと等しい。すなわち m.update(a); m.update(b) は + m.update(a + b) と、 m << a << b は m << a + b とそれぞれ等価 + である。 + + == md + + 与えられたダイジェストオブジェクトと比較する。 + + == str + + 与えられた文字列を digest 値、もしくは hexdigest 値と比較する。 + いずれの値と見るかは与えられた文字列の長さによって自動判別 + される。 + +------------------------------------------------------- +Local variables: +fill-column: 70 +end: |