NAME

Compress::Huffman::Binary - Binary-only Huffman coding

SYNOPSIS

use FindBin '$Bin';
use Compress::Huffman::Binary ':all';
my $input = 'something or another';
my $output = huffman_encode ($input);
my $roundtrip = huffman_decode ($output);
if ($input eq $roundtrip) {
    print "OK.\n";
}
else {
    print "FAIL!\n";
}

produces output

OK.

(This example is included as synopsis.pl in the distribution.)

VERSION

This documents version 0.00_02 of Compress::Huffman::Binary corresponding to git commit fb0fc8543c07cdb20043149189faee34bd1a1592 released on Tue Sep 27 11:28:52 2016 +0900.

DESCRIPTION

This is a binary-only version of Compress::Huffman, written in C, which supports encoding of input to a file.

FUNCTIONS

huffman_encode

my $out = huffman_encode ($in);

huffman_decode

my $out = huffman_decode ($in);

EXPORTS

"huffman_encode" and "huffman_decode" are exported on request.

AUTHOR

Ben Bullock, <bkb@cpan.org>

Request

If you'd like to see this module continued, let me know that you're using it. For example, send an email, write a bug report, star the project's github repository, add a patch, add a ++ on Metacpan.org, or write a rating at CPAN ratings. It really does make a difference. Thanks.

COPYRIGHT & LICENCE

This package and associated files are copyright (C) 2016 Ben Bullock.

You can use, copy, modify and redistribute this package and associated files under the Perl Artistic Licence or the GNU General Public Licence.

This module is based on https://github.com/drichardson/huffman by Doug Richardson. The licence for that software is as follows:

Copyright (c) 2007, Douglas Ryan Richardson, Gauss Interprise, Inc

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

* Neither the name of Gauss Interprise, Inc nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.