From 3ec97f3732ff78aff36ca04153a7a4b4a82bf2c2 Mon Sep 17 00:00:00 2001 From: technorama Date: Mon, 25 Feb 2008 08:51:18 +0000 Subject: * 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/trunk@15602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/openssl/lib/openssl/digest.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ext/openssl/lib') diff --git a/ext/openssl/lib/openssl/digest.rb b/ext/openssl/lib/openssl/digest.rb index 8d7df73b54..4810f0121b 100644 --- a/ext/openssl/lib/openssl/digest.rb +++ b/ext/openssl/lib/openssl/digest.rb @@ -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 -- cgit v1.2.3