Sha256: d8c395decb92067634861192a94ceeacbf5865dac6dbd71e5ff1fd2cee7f42a0

Contents?: true

Size: 594 Bytes

Versions: 22

Compression:

Stored size: 594 Bytes

Contents

require 'sym/errors'
require 'base64'
require 'zlib'

require 'sym/data/wrapper_struct'
require 'sym/data/encoder'
require 'sym/data/decoder'

module Sym
  # This module is responsible for taking arbitrary data of any format, and safely compressing
  # the result of `Marshal.dump(data)` using Zlib, and then doing `#urlsafe_encode64` encoding
  # to convert it to a string,
  module Data
    def encode(data, compress = true)
      Encoder.new(data, compress).data_encoded
    end

    def decode(data_encoded, compress = nil)
      Decoder.new(data_encoded, compress).data
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
sym-3.0.0 lib/sym/data.rb
sym-2.10.0 lib/sym/data.rb
sym-2.8.5 lib/sym/data.rb
sym-2.8.4 lib/sym/data.rb
sym-2.8.2 lib/sym/data.rb
sym-2.8.1 lib/sym/data.rb
sym-2.8.0 lib/sym/data.rb
sym-2.7.0 lib/sym/data.rb
sym-2.6.3 lib/sym/data.rb
sym-2.6.2 lib/sym/data.rb
sym-2.6.1 lib/sym/data.rb
sym-2.6.0 lib/sym/data.rb
sym-2.5.3 lib/sym/data.rb
sym-2.5.1 lib/sym/data.rb
sym-2.5.0 lib/sym/data.rb
sym-2.4.3 lib/sym/data.rb
sym-2.3.0 lib/sym/data.rb
sym-2.2.1 lib/sym/data.rb
sym-2.2.0 lib/sym/data.rb
sym-2.1.2 lib/sym/data.rb