concord-consortium/rigse

View on GitHub
rails/lib/b64.rb

Summary

Maintainability
A
25 mins
Test Coverage
module B64
  class B64
    def self.folding_encode(str, eol = "\n", limit = 60)
      [str].pack('m')
    end

    def self.encode(str)
      [str].pack('m').tr( "\r\n", '')
    end

    def self.decode(str, strict = false)
      str.unpack('m').first
    end
  end
end