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.12 lib/spid/ruby-saml/coding.rb
spid-es-0.0.11 lib/spid/ruby-saml/coding.rb
spid-es-0.0.10 lib/spid/ruby-saml/coding.rb
spid-es-0.0.9 lib/spid/ruby-saml/coding.rb
spid-es-0.0.8 lib/spid/ruby-saml/coding.rb
spid-es-0.0.7 lib/spid/ruby-saml/coding.rb
spid-es-0.0.6 lib/spid/ruby-saml/coding.rb
spid-es-0.0.5 lib/spid/ruby-saml/coding.rb
spid-es-0.0.4 lib/spid/ruby-saml/coding.rb
spid-es-0.0.3 lib/spid/ruby-saml/coding.rb
spid-es-0.0.2 lib/spid/ruby-saml/coding.rb
spid-es-0.0.1 lib/spid/ruby-saml/coding.rb