module Base64

def self.decode64(data)

# => "Original unencoded string"
ActiveSupport::Base64.decode64("T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw==")

Decodes a base 64 encoded string to its original representation.
def self.decode64(data)
  data.unpack("m").first
end

def self.encode64(data)

# => "T3JpZ2luYWwgdW5lbmNvZGVkIHN0cmluZw==\n"
ActiveSupport::Base64.encode64("Original unencoded string")

output is separated by a newline character.
Encodes a string to its base 64 representation. Each 60 characters of
def self.encode64(data)
  [data].pack("m")
end