~ubuntu-branches/ubuntu/quantal/ruby1.9.1/quantal

« back to all changes in this revision

Viewing changes to ext/openssl/lib/openssl/digest.rb

  • Committer: Bazaar Package Importer
  • Author(s): Lucas Nussbaum
  • Date: 2011-09-24 19:16:17 UTC
  • mfrom: (1.1.8 upstream) (13.1.7 experimental)
  • Revision ID: james.westby@ubuntu.com-20110924191617-o1qz4rcmqjot8zuy
Tags: 1.9.3~rc1-1
* New upstream release: 1.9.3 RC1.
  + Includes load.c fixes. Closes: #639959.
* Upload to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
=begin
2
 
= $RCSfile$ -- Ruby-space predefined Digest subclasses
3
 
 
4
 
= Info
5
 
  'OpenSSL for Ruby 2' project
6
 
  Copyright (C) 2002  Michal Rokos <m.rokos@sh.cvut.cz>
7
 
  All rights reserved.
8
 
 
9
 
= Licence
10
 
  This program is licenced under the same licence as Ruby.
11
 
  (See the file 'LICENCE'.)
12
 
 
13
 
= Version
14
 
  $Id: digest.rb 26743 2010-02-23 17:33:39Z knu $
15
 
=end
16
 
 
17
 
##
18
 
# Should we care what if somebody require this file directly?
19
 
#require 'openssl'
 
1
#--
 
2
#
 
3
# $RCSfile$
 
4
#
 
5
# = Ruby-space predefined Digest subclasses
 
6
 
7
# = Info
 
8
# 'OpenSSL for Ruby 2' project
 
9
# Copyright (C) 2002  Michal Rokos <m.rokos@sh.cvut.cz>
 
10
# All rights reserved.
 
11
 
12
# = Licence
 
13
# This program is licenced under the same licence as Ruby.
 
14
# (See the file 'LICENCE'.)
 
15
 
16
# = Version
 
17
# $Id: digest.rb 33067 2011-08-25 00:52:10Z drbrain $
 
18
#
 
19
#++
20
20
 
21
21
module OpenSSL
22
22
  class Digest
26
26
      alg += %w(SHA224 SHA256 SHA384 SHA512)
27
27
    end
28
28
 
 
29
    # Return the +data+ hash computed with +name+ Digest. +name+ is either the
 
30
    # long name or short name of a supported digest algorithm.
 
31
    #
 
32
    # === Examples
 
33
    #
 
34
    #   OpenSSL::Digest.digest("SHA256, "abc")
 
35
    #
 
36
    # which is equivalent to:
 
37
    #
 
38
    #   OpenSSL::Digest::SHA256.digest("abc")
 
39
 
29
40
    def self.digest(name, data)
30
41
        super(data, name)
31
42
    end