зеркало из https://github.com/github/ruby.git
* ext/sha1/sha1.txt.jp: add the Japanese version derived from
ext/md5/md5.txt.jp. * ext/sha1/sha1.txt: revise the copyright info and reduce the difference from ext/md5/md5.txt. * ext/md5/md5.txt: reduce the difference from ext/sha1/sha1.txt. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ca841613cd
Коммит
a57dc21ef0
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
Thu May 17 07:16:38 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* ext/sha1/sha1.txt.jp: add the Japanese version derived from
|
||||
ext/md5/md5.txt.jp.
|
||||
|
||||
* ext/sha1/sha1.txt: revise the copyright info and reduce the
|
||||
difference from ext/md5/md5.txt.
|
||||
|
||||
* ext/md5/md5.txt: reduce the difference from ext/sha1/sha1.txt.
|
||||
|
||||
Thu May 17 07:11:35 2001 Akinori MUSHA <knu@iDaemons.org>
|
||||
|
||||
* ext/sha1/extconf.rb, ext/sha1/sha1.c: use WORDS_BIGENDIAN to
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
A class to implement MD5 Message-Digest Algorithm by RSA Data
|
||||
Security, Inc., described in RFC1321.
|
||||
|
||||
SuperClass: Object
|
||||
Superclass: Object
|
||||
|
||||
Class Methods:
|
||||
|
||||
|
|
|
@ -1,33 +1,36 @@
|
|||
Class SHA1
|
||||
.\" sha1.doc - -*- Indented-Text -*- created at: Thu Mat 17 06:51:50 JST 2001
|
||||
|
||||
A class to implement the SHA1 Secure Hash Algorithm by NIST (the US'
|
||||
National Institute of Standards and Technology), described in FIPS PUB
|
||||
180-1.
|
||||
** SHA1(Class)
|
||||
|
||||
A class to implement the SHA1 Secure Hash Algorithm by NIST (the US'
|
||||
National Institute of Standards and Technology), described in FIPS PUB
|
||||
180-1.
|
||||
|
||||
Superclass: Object
|
||||
|
||||
Class Methods:
|
||||
|
||||
new([str])
|
||||
sha1([str])
|
||||
new([str])
|
||||
sha1([str])
|
||||
|
||||
Creates a new SHA1 object. If a string argument is given, it
|
||||
is added to the object. (see update.)
|
||||
|
||||
Methods:
|
||||
|
||||
clone
|
||||
clone
|
||||
|
||||
Copies the SHA1 object.
|
||||
|
||||
digest
|
||||
digest
|
||||
|
||||
Returns the SHA1 hash of the added strings as a string of 20 bytes.
|
||||
Returns the SHA1 hash of the added strings as a string of 20
|
||||
bytes.
|
||||
|
||||
hexdigest
|
||||
hexdigest
|
||||
|
||||
Returns the SHA1 hash of the added strings as a string of 40
|
||||
hexadecimal digits. This method is equal to:
|
||||
hexadecimal digits. This method is equal to:
|
||||
|
||||
def hexdigest
|
||||
ret = ''
|
||||
|
@ -35,8 +38,8 @@ Methods:
|
|||
ret
|
||||
end
|
||||
|
||||
update(str)
|
||||
<< str
|
||||
update(str)
|
||||
<< str
|
||||
|
||||
Updates the SHA1 object with string str. Repeated calls are
|
||||
equivalent to a single call with the concatenation of all the
|
||||
|
@ -45,6 +48,9 @@ Methods:
|
|||
|
||||
Copyright:
|
||||
|
||||
README and sha1-ruby.c are derived from the Ruby source and so fall
|
||||
under the same license as Ruby. The rest of this package is in the
|
||||
public domain.
|
||||
sha1.c is in the public domain.
|
||||
|
||||
-------------------------------------------------------
|
||||
Local variables:
|
||||
fill-column: 70
|
||||
end:
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
.\" 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:
|
Загрузка…
Ссылка в новой задаче