Module: Ronin::Support::Encoding::UUEncoding

Defined in:
lib/ronin/support/encoding/uuencoding.rb

Overview

Contains methods for encoding/decoding UUEncoded data.

Core-Ext Methods

Since:

  • 1.0.0

Class Method Summary collapse

Class Method Details

.decode(data) ⇒ String

Decodes the uuencoded String.

Examples:

Encoding::UUEncoding.encode("+:&5L;&\\@=V]R;&0`\n")
# => "hello world"

Parameters:

  • data (String)

    The data to uudecode.

Returns:

  • (String)

    The decoded String.

Since:

  • 1.0.0



69
70
71
# File 'lib/ronin/support/encoding/uuencoding.rb', line 69

def self.decode(data)
  data.unpack1('u')
end

.encode(data) ⇒ String

uuencodes the String.

Examples:

Encoding::UUEncoding.encode("hello world")
# => "+:&5L;&\\@=V]R;&0`\n"

Parameters:

  • data (String)

    The data to uuencode.

Returns:

  • (String)

    The UU encoded String.

Since:

  • 1.0.0



50
51
52
# File 'lib/ronin/support/encoding/uuencoding.rb', line 50

def self.encode(data)
  [data].pack('u')
end