1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/digest/lib/sha1.rb
knu 5f7bda0735 * 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
2007-03-06 09:55:50 +00:00

23 lines
342 B
Ruby

# just for compatibility; requiring "sha1" is obsoleted
#
# $RoughId: sha1.rb,v 1.4 2001/07/13 15:38:27 knu Exp $
# $Id$
require 'digest/sha1'
SHA1 = Digest::SHA1
class << SHA1
alias orig_new new
def new(str = nil)
if str
orig_new.update(str)
else
orig_new
end
end
def sha1(*args)
new(*args)
end
end