10 # Base64 provides utility methods for encoding and de-coding binary data
11 # using a base 64 representation. A base 64 representation of binary data
12 # consists entirely of printable US-ASCII characters. The Base64 module
13 # is included in Ruby 1.8, but has been removed in Ruby 1.9.
15 # Encodes a string to its base 64 representation. Each 60 characters of
16 # output is separated by a newline character.
18 # ActiveSupport::Base64.encode64("Original unencoded string")
19 # # => "T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw==\n"
20 def self.encode64(data)
24 # Decodes a base 64 encoded string to its original representation.
26 # ActiveSupport::Base64.decode64("T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw==")
27 # # => "Original unencoded string"
28 def self.decode64(data)
29 data.unpack("m").first