App-Muter

 view release on metacpan or  search on metacpan

bin/muter  view on Meta::CPAN

=over 4

=item B<-c> I<chain>, B<--chain>=I<chain>

Specify the chain of transforms.  This option is mandatory.

=item B<-r>, B<--reverse>

Reverse the chain of transforms and convert each forward transform to a reverse
transform, and vice versa.  Assuming all transforms can be inverted, running an
instance of B<muter> without this flag followed by an instance with this flag
and with the same chain returns the original data.

It is not valid to specify this flag with transforms that have no inverse.

=item B<--help>

List usage and all known transforms.

=item B<--verbose>

With B<--help>, provide a description for each transform parameter.

=back

=head1 BACKENDS

The following backends are included with muter; additional backends can be used
by creating modules under the C<App::Muter::Backend> namespace in C<@INC>.

=head2 ascii85

Implements the L<Ascii85 encoding|https://en.wikipedia.org/wiki/Ascii85>.

=head2 base16

Equivalent to the C<hex> backend with the C<upper> argument.  Implements the
L<RFC 4648|https://tools.ietf.org/html/rfc4648> Base16 encoding.

=head2 base32

Implements the L<RFC 4648|https://tools.ietf.org/html/rfc4648> Base32 encoding.

Accepts one option, C<manual>, which forces the use of the built-in encoder
instead of L<MIME::Base32>.  This built-in encoder is forced if L<MIME::Base32>
is missing or too old.

=head2 base32hex

Implements the L<RFC 4648|https://tools.ietf.org/html/rfc4648> Base32 with
Extended Hex Alphabet encoding, better known as C<base32hex>.

Accepts one option, C<manual>, which does the same thing as for C<base32>.

=head2 base64

Implements the L<RFC 4648|https://tools.ietf.org/html/rfc4648> Base64 encoding.

=head2 form

Implements URI percent encoding, like C<uri>, except it encodes space as C<+>
instead of C<%20>, as for use in  I<application/x-www-form-urlencoded>.  This
used to be written C<uri(form)>, which is no longer allowed.

Otherwise accepts the same options as C<uri> (C<lower> and C<upper>).

=head2 hash

Implements a cryptographic hash of the input data.  There is no corresponding
reverse transform.

The following hash algorithms are supported:

=over 4

=item md5

=item sha1

=item sha224

=item sha256

=item sha3-224

=item sha3-256

=item sha3-384

=item sha3-512

=item sha384

=item sha512

=back

=head2 hex

Implements hex encoding.  Takes two options, C<lower> and C<upper>, that control
which type of letters are used.

=head2 identity

Implements the identity transform.  Passes through the input unmodified.

=head2 quotedprintable

Implements quoted-printable MIME encoding.  With the option C<smtp>, encodes "."
and "From " if they appear at the beginning of a line (including beginning of
input).

=head2 uri

Implements URI percent encoding.

Takes two possible options.  C<lower> and C<upper> control the type of hex
character emitted.

=head2 url64

Implements the L<RFC 4648|https://tools.ietf.org/html/rfc4648> Base64 Encdoing
with URL and Filename Safe Alphabet.

=head2 uuencode

Implements UUencoding.  Note that the "begin" and "end" markers are not emitted.

=head2 vis

Implements the L<vis(3)> function found on the BSDs.  The options supported
correspond directly to the constants that function takes.

The default encoding, if neither C<cstyle> nor C<octal> is specified, is to
encode control characters in the form C<\^C>, control characters with the eighth
bit set in the form C<\M^C>, other characters with the eighth bit in the form
C<\M-C>, and space and meta-space as octal escapes.

The flags C<httpstyle> and C<mimestyle> are not implemented.  Instead, use the
C<uri> and C<quotedprintable> encoders.

=over 4

=item cstyle

Use C-style backslash escapes for common control characters.  Space is encoded
as C<\s>.  NUL is encoded as C<\0> if the next character is not an octal digit
and C<\000> if it is.

=item glob

Encode the characters C<*>, C<?>, C<[> and C<#>, which are recognized by
L<glob(3)>.

=item nl

Encode newline.

=item octal

Encode characters as three-digit octal escapes.

=item sp

=item space

Encode space (U+0020).

=item tab

Encode tab.

=item white

Encode whitespace.  Equivalent to C<space,tab,nl>.

=back

=head2 xml

Implements encoding of XML special characters.  Note that the reverse transform
decodes arbitrary decimal and hexadecimal entities into UTF-8.

Takes one of the following three arguments:

=over 4

=item default

Use XML entity names.

=item hex

Use hexadecimal entity names for all entities.

=item html

Use XML entitiy names, except for the apostrophe, which uses a hexadecimal
entity.

=back

=head1 EXAMPLES

=over 4

=item B<muter> B<-c> -base64:uri

Decode the standard input as Base64 and output it, encoding it using URI
percent-encoding.

=item B<muter> B<-r> B<-c> -uri:base64

Exactly the same as the above.

=item B<muter> B<-c> -hex:hash(sha256):base64 I<file>

Read from I<file>, which contains a single hex-encoded string, hash the result
with SHA-256, and encode the result as base64.  This chain could also be written
as C<-hex:hash,sha256:base64>, which may be easier to type.

=back

=cut

use strict;
use warnings;

use App::Muter;

exit App::Muter::Main::script(@ARGV) unless caller;



( run in 2.138 seconds using v1.01-cache-2.11-cpan-7fcb06a456a )