mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00

Digest::MD5. * ext/digest/lib/sha1.rb (SHA1::new, SHA1::sha1): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
23 lines
377 B
Ruby
23 lines
377 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'
|
|
|
|
class SHA1 < Digest::SHA1
|
|
class << self
|
|
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
|
|
end
|