mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/digest/lib/md5.rb (MD5::md5): Catch up with Digest's API
changes; noted by: Kazuhiro Yoshida <moriq AT moriq.com> in [ruby-dev:30500]. * ext/digest/lib/sha1.rb (SHA1::sha1): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ddeae36d8e
commit
5f7bda0735
3 changed files with 30 additions and 4 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
Tue Mar 6 18:44:26 2007 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
|
* ext/digest/lib/md5.rb (MD5::new, MD5::md5): Catch up with
|
||||||
|
Digest's API changes; noted by: Kazuhiro Yoshida <moriq AT
|
||||||
|
moriq.com> in [ruby-dev:30500].
|
||||||
|
|
||||||
|
* ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto.
|
||||||
|
|
||||||
Tue Mar 6 18:24:19 2007 Akinori MUSHA <knu@iDaemons.org>
|
Tue Mar 6 18:24:19 2007 Akinori MUSHA <knu@iDaemons.org>
|
||||||
|
|
||||||
* time.c (time_to_s): Back out the format changes; discussed
|
* time.c (time_to_s): Back out the format changes; discussed
|
||||||
|
|
|
@ -7,8 +7,17 @@ require 'digest/md5'
|
||||||
|
|
||||||
MD5 = Digest::MD5
|
MD5 = Digest::MD5
|
||||||
|
|
||||||
class MD5
|
class << MD5
|
||||||
def self.md5(*args)
|
alias orig_new new
|
||||||
|
def new(str = nil)
|
||||||
|
if str
|
||||||
|
orig_new.update(str)
|
||||||
|
else
|
||||||
|
orig_new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def md5(*args)
|
||||||
new(*args)
|
new(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -7,8 +7,17 @@ require 'digest/sha1'
|
||||||
|
|
||||||
SHA1 = Digest::SHA1
|
SHA1 = Digest::SHA1
|
||||||
|
|
||||||
class SHA1
|
class << SHA1
|
||||||
def self.sha1(*args)
|
alias orig_new new
|
||||||
|
def new(str = nil)
|
||||||
|
if str
|
||||||
|
orig_new.update(str)
|
||||||
|
else
|
||||||
|
orig_new
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def sha1(*args)
|
||||||
new(*args)
|
new(*args)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue