ruby--ruby/ext/sha1/sha1.txt.jp

58 lines
1.3 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

.\" sha1.doc - -*- Indented-Text -*- created at: Thu Mat 17 06:51:50 JST 2001
** SHA1(クラス)
FIPS PUB 180-1に記述されているNIST (the US' National Institute of
Standards and Technology) の SHA1 Secure Hash Algorithm Algorithmを実装
するクラス。
SuperClass: Object
Class Methods:
new([str])
sha1([str])
新しいSHA1オブジェクトを生成する文字列引数が与えられるとそれ
を追加する(see update)。
Methods:
clone
SHA1オブジェクトの複製を作る。
digest
今までに追加した文字列に対するハッシュ値を20バイト長の文字列で
返す。
hexdigest
今までに追加した文字列に対するハッシュ値を、ASCIIコードを使って
16進数の列を示す'18e40e1401eef67e1ae69efab09afb71f87ffb81'のよう
な40文字の文字列にエンコードして返す。Rubyで書くと以下と同じ。
def hexdigest
ret = ''
digest.each_byte {|i| ret << sprintf('%02x', i) }
ret
end
update(str)
<< str
SHA1オブジェクトに文字列を追加する。複数回updateを呼ぶことは文
字列を連結してupdateを呼ぶことと等しい。すなわち m.update(a);
m.update(b) は m.update(a+b) と、 m << a << b は m << a+b と
それぞれ等価である。
Copyright:
sha1.c はパブリックドメインである。
-------------------------------------------------------
Local variables:
fill-column: 70
end: