Sha256: b106852f6629753e4611aed227ff94bc3a615ab5a040408ef11ed284ae20fc8f

Contents?: true

Size: 662 Bytes

Versions: 7

Compression:

Stored size: 662 Bytes

Contents

require 'digest'

module Digest

  module Instance

    # For Ruby < 1.9.2
   
    unless instance_methods.include? :base64digest

      # From Ruby 1.9.2 source
      def base64digest(str = nil)
        [str ? digest(str) : digest].pack('m0')
      end

    end

    unless instance_methods.include? :base64digest!

      # From Ruby 1.9.2 source
      def base64digest!
        [digest!].pack('m0')
      end

    end

  end

  class Class

    # For Ruby < 1.9.2   

    unless methods.include? :base64digest

      # From Ruby 1.9.2 source
      def self.base64digest(str, *args)
        [self.digest(str, *args)].pack('m0') 
      end

    end

  end

end

Version data entries

7 entries across 6 versions & 2 rubygems

Version Path
facets-glimmer-3.2.0 lib/standard/facets/digest/base64digest.rb
facets-3.1.0 lib/standard/facets/digest/base64digest.rb
facets-3.0.0 lib/standard/facets/digest/base64digest.rb
facets-2.9.3 lib/standard/facets/digest/base64digest.rb
facets-2.9.2 src/standard/facets/digest/base64digest.rb
facets-2.9.2 lib/standard/facets/digest/base64digest.rb
facets-2.9.1 lib/standard/facets/digest/base64digest.rb