module Ronin::Support::Compression::Zlib

Methods for zlib compression.

@api public

@since 1.0.0

Public Class Methods

deflate(string) click to toggle source

Zlib deflate a string.

@param [String] string

The uncompressed input.

@return [String]

The Zlib deflated form of the input.

@example

Compression::Zlib.deflate("hello")
# => "x\x9C\xCBH\xCD\xC9\xC9\a\x00\x06,\x02\x15"

@api public

# File lib/ronin/support/compression/zlib.rb, line 72
def self.deflate(string)
  ::Zlib::Deflate.deflate(string)
end
inflate(string) click to toggle source

Zlib inflate a string.

@param [String] string

The Zlib compressed input.

@return [String]

The Zlib inflated form of the input.

@example

Compression::Zlib.inflate("x\x9C\xCBH\xCD\xC9\xC9\a\x00\x06,\x02\x15")
# => "hello"

@api public

# File lib/ronin/support/compression/zlib.rb, line 53
def self.inflate(string)
  ::Zlib::Inflate.inflate(string)
end