Sha256: 9a42c0f31ed5492d170a7622dce45fa4897911a015cb83825b5efe36aa18a9fd

Contents?: true

Size: 595 Bytes

Versions: 10

Compression:

Stored size: 595 Bytes

Contents

require "cgi"
require 'zlib'

module Ciam
  module Saml
    module Coding
      def decode(encoded)
        Base64.decode64(encoded)
      end

      def encode(encoded)
        Base64.encode64(encoded).gsub(/\n/, "")
      end

      def escape(unescaped)
        CGI.escape(unescaped)
      end

      def unescape(escaped)
        CGI.unescape(escaped)
      end

      def inflate(deflated)
        zlib = Zlib::Inflate.new(-Zlib::MAX_WBITS)
        zlib.inflate(deflated)
      end

      def deflate(inflated)
        Zlib::Deflate.deflate(inflated, 9)[2..-5]
      end

    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ciam-es-0.1.0 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.9 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.8 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.7 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.6 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.5 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.4 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.3 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.2 lib/ciam/ruby-saml/coding.rb
ciam-es-0.0.1 lib/ciam/ruby-saml/coding.rb