Sha256: 945bef2622472f65e032b238199136c23c1d4177dee98baf54d63f582c2b445e

Contents?: true

Size: 615 Bytes

Versions: 10

Compression:

Stored size: 615 Bytes

Contents

require_relative 'errors'
require 'base64'
require 'zlib'

require_relative 'data/wrapper_struct'
require_relative 'data/encoder'
require_relative 'data/decoder'

module Shhh
  # 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

10 entries across 10 versions & 1 rubygems

Version Path
shhh-1.7.0 lib/shhh/data.rb
shhh-1.6.5 lib/shhh/data.rb
shhh-1.6.4 lib/shhh/data.rb
shhh-1.6.3 lib/shhh/data.rb
shhh-1.6.2 lib/shhh/data.rb
shhh-1.6.1 lib/shhh/data.rb
shhh-1.5.4 lib/shhh/data.rb
shhh-1.4.1 lib/shhh/data.rb
shhh-1.4.0 lib/shhh/data.rb
shhh-1.3.0 lib/shhh/data.rb