Sha256: f0bd6b2967ac3126b8892ef8b8c52bff53a02645be721cc7cf17d8da85c1f301

Contents?: true

Size: 595 Bytes

Versions: 52

Compression:

Stored size: 595 Bytes

Contents

require "cgi"
require 'zlib'

module Spid
  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

52 entries across 52 versions & 1 rubygems

Version Path
spid-es-0.0.52 lib/spid/ruby-saml/coding.rb
spid-es-0.0.51 lib/spid/ruby-saml/coding.rb
spid-es-0.0.50 lib/spid/ruby-saml/coding.rb
spid-es-0.0.49 lib/spid/ruby-saml/coding.rb
spid-es-0.0.48 lib/spid/ruby-saml/coding.rb
spid-es-0.0.47 lib/spid/ruby-saml/coding.rb
spid-es-0.0.46 lib/spid/ruby-saml/coding.rb
spid-es-0.0.45 lib/spid/ruby-saml/coding.rb
spid-es-0.0.44 lib/spid/ruby-saml/coding.rb
spid-es-0.0.43 lib/spid/ruby-saml/coding.rb
spid-es-0.0.42 lib/spid/ruby-saml/coding.rb
spid-es-0.0.41 lib/spid/ruby-saml/coding.rb
spid-es-0.0.40 lib/spid/ruby-saml/coding.rb
spid-es-0.0.39 lib/spid/ruby-saml/coding.rb
spid-es-0.0.38 lib/spid/ruby-saml/coding.rb
spid-es-0.0.37 lib/spid/ruby-saml/coding.rb
spid-es-0.0.36 lib/spid/ruby-saml/coding.rb
spid-es-0.0.35 lib/spid/ruby-saml/coding.rb
spid-es-0.0.34 lib/spid/ruby-saml/coding.rb
spid-es-0.0.33 lib/spid/ruby-saml/coding.rb