module Ronin::Support::Encoding::QuotedPrintable
Contains methods for encoding/decoding Quoted Printable data.
## Core-Ext Methods
-
{String#quoted_printable_escape}
-
{String#quoted_printable_unescape}
@see en.wikipedia.org/wiki/Quoted-printable
@api public
Public Class Methods
Source
# File lib/ronin/support/encoding/quoted_printable.rb, line 101 def self.decode(data) unescape(data) end
Alias for {unescape}.
@param [String] data
The Quoted-Printable String to unescape.
@return [String]
The unescaped String.
@see unescape
Source
# File lib/ronin/support/encoding/quoted_printable.rb, line 67 def self.encode(data) escape(data) end
Alias for {escape}.
@param [String] data
The data to escape.
@return [String]
The quoted-printable escaped String.
@see escape
Source
# File lib/ronin/support/encoding/quoted_printable.rb, line 52 def self.escape(data) [data].pack('M') end
Escapes the data as Quoted Printable.
@param [String] data
The data to escape.
@return [String]
The quoted-printable escaped String.
@example
Encoding::QuotedPrintable.escape('<a href="https://example.com/">link</a>') # => "<a href=3D\"https://example.com/\">link</a>=\n"
Source
# File lib/ronin/support/encoding/quoted_printable.rb, line 86 def self.unescape(data) data.unpack1('M') end
Unescapes a Quoted Printable encoded String
.
@param [String] data
The Quoted-Printable String to unescape.
@return [String]
The unescaped String.
@example
Encoding::QuotedPrintable.unescape("<a href=3D\"https://example.com/\">link</a>=\n") # => "<a href=\"https://example.com/\">link</a>"