mirror of
https://github.com/ruby/ruby.git
synced 2025-09-20 11:03:58 +02:00
* ext/openssl: imported.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
fd46a1da0a
commit
231247c010
63 changed files with 12561 additions and 0 deletions
44
ext/openssl/lib/openssl/digest.rb
Normal file
44
ext/openssl/lib/openssl/digest.rb
Normal file
|
@ -0,0 +1,44 @@
|
|||
=begin
|
||||
= $RCSfile$ -- Ruby-space predefined Digest subclasses
|
||||
|
||||
= Info
|
||||
'OpenSSL for Ruby 2' project
|
||||
Copyright (C) 2002 Michal Rokos <m.rokos@sh.cvut.cz>
|
||||
All rights reserved.
|
||||
|
||||
= Licence
|
||||
This program is licenced under the same licence as Ruby.
|
||||
(See the file 'LICENCE'.)
|
||||
|
||||
= Version
|
||||
$Id$
|
||||
=end
|
||||
|
||||
##
|
||||
# Should we care what if somebody require this file directly?
|
||||
#require 'openssl'
|
||||
|
||||
module OpenSSL
|
||||
module Digest
|
||||
|
||||
%w(DSS DSS1 MD2 MD4 MD5 MDC2 RIPEMD160 SHA SHA1).each{|digest|
|
||||
eval(<<-EOD)
|
||||
class #{digest} < Digest
|
||||
def initialize(data=nil)
|
||||
super(\"#{digest}\", data)
|
||||
end
|
||||
|
||||
def #{digest}::digest(data)
|
||||
Digest::digest(\"#{digest}\", data)
|
||||
end
|
||||
|
||||
def #{digest}::hexdigest(data)
|
||||
Digest::hexdigest(\"#{digest}\", data)
|
||||
end
|
||||
end
|
||||
EOD
|
||||
}
|
||||
|
||||
end # Digest
|
||||
end # OpenSSL
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue