diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-22 08:29:58 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-06-22 08:29:58 +0000 |
commit | 44cf56d6e70dbe06a160b004494ba40dd4cfb426 (patch) | |
tree | 10e665c60414c3070ce957e5c534e30ed499bc2d /ext/md5 | |
parent | 4b4cad81e7d2bdc4750ea5043ce44bf37adb3997 (diff) |
2000-06-22
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/md5')
-rw-r--r-- | ext/md5/md5.txt | 11 | ||||
-rw-r--r-- | ext/md5/md5.txt.jp | 12 |
2 files changed, 23 insertions, 0 deletions
diff --git a/ext/md5/md5.txt b/ext/md5/md5.txt index 0eca7c9025..e2b072401b 100644 --- a/ext/md5/md5.txt +++ b/ext/md5/md5.txt @@ -25,6 +25,17 @@ Methods: returns have value of the added strings as a 16 bytes string. + hexdigest + + returns have value of the added strings as an 32 bytes ASCII + string. This method is equal to: + + def hexdigest + ret = '' + digest.each_byte {|i| ret << sprintf('%02x', i) } + ret + end + update(str) Update the MD5 object with the string. Repeated calls are diff --git a/ext/md5/md5.txt.jp b/ext/md5/md5.txt.jp index a1451f1175..04cf32908d 100644 --- a/ext/md5/md5.txt.jp +++ b/ext/md5/md5.txt.jp @@ -26,6 +26,18 @@ Methods: 今までに追加した文字列に対するハッシュ値を16バイト長の文字列で 返す. + hexdigest + + 今までに追加した文字列に対するハッシュ値を、ASCIIコードを使って + 16進数の列を示す'fe5c2235f48d2bcc911afabea23cd5aa'のような32文字 + の文字列にエンコードして返す。Rubyで書くと以下と同じ。 + + def hexdigest + ret = '' + digest.each_byte {|i| ret << sprintf('%02x', i) } + ret + end + update(str) MD5オブジェクトに文字列を追加する。複数回updateを呼ぶことは文 |