Sha256: 9c2520d185fdff7e34c8fce99e52c37cfd2054d0124783e7ec1e2b247bc33946

Contents?: true

Size: 586 Bytes

Versions: 11

Compression:

Stored size: 586 Bytes

Contents

require "cgi"
require 'zlib'

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

      def encode(encoded)
        Base64.strict_encode64(encoded)
      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

11 entries across 11 versions & 1 rubygems

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