Sha256: 8b813ecacec80ff86d38122171085a49ef86e5bacd500d3cac7a6b8432f7f721

Contents?: true

Size: 573 Bytes

Versions: 1

Compression:

Stored size: 573 Bytes

Contents

require 'base64'
require 'zlib'

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

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

1 entries across 1 versions & 1 rubygems

Version Path
sym-crypt-1.2.0 lib/sym/data.rb