Module: Ronin::Support::Compression::Zlib

Includes:
Zlib
Defined in:
lib/ronin/support/compression/zlib.rb

Overview

Methods for zlib compression.

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.deflate(string) ⇒ String

Zlib deflate a string.

Examples:

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

Parameters:

  • string (String)

    The uncompressed input.

Returns:

  • (String)

    The Zlib deflated form of the input.

Since:

  • 1.0.0



72
73
74
# File 'lib/ronin/support/compression/zlib.rb', line 72

def self.deflate(string)
  ::Zlib::Deflate.deflate(string)
end

.inflate(string) ⇒ String

Zlib inflate a string.

Examples:

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

Parameters:

  • string (String)

    The Zlib compressed input.

Returns:

  • (String)

    The Zlib inflated form of the input.

Since:

  • 1.0.0



53
54
55
# File 'lib/ronin/support/compression/zlib.rb', line 53

def self.inflate(string)
  ::Zlib::Inflate.inflate(string)
end