aboutsummaryrefslogblamecommitdiffstats
path: root/activesupport/lib/active_support/base64.rb
blob: 4fc8cd13a7b109a6140df85180a0384056a57520 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
















                                                           
module ActiveSupport
  if defined? ::Base64
    Base64 = ::Base64
  else
    # Ruby 1.9 doesn't provide base64, so we wrap this here
    module Base64

      def self.encode64(data)
        [data].pack("m")
      end

      def self.decode64(data)
        data.unpack("m").first
      end
    end
  end
end