Mon Feb 25 17:30:29 2008 Technorama Ltd. <oss-ruby@technorama.net>

* ext/openssl/digest.c ext/openssl/lib/openssl/digest.rb:
	  Commit patch #9280 from Akinori MUSHA.
	  Simplify the OpenSSL::Digest class and make use of the
	  existing Digest framework.
	  Enhance performance.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
technorama 2008-02-25 08:48:57 +00:00
parent c971b7a0b9
commit 00be63fca5
2 changed files with 44 additions and 125 deletions

View file

@ -26,6 +26,10 @@ module OpenSSL
alg += %w(SHA224 SHA256 SHA384 SHA512)
end
def self.digest(name, data)
super(data, name)
end
alg.each{|name|
klass = Class.new(Digest){
define_method(:initialize){|*data|
@ -46,7 +50,10 @@ module OpenSSL
# This class is only provided for backwards compatibility. Use OpenSSL::Digest in the future.
class Digest < Digest
# add warning
def initialize(*args)
# add warning
super(*args)
end
end
end # Digest