Compress::LZ4Frame - Compression package using the lz4frame library
version 0.003
use Compress::LZ4Frame qw(:all); my @data = map { rand } (1..50000); my $packed = pack('d*', @data); # compress my $compressed = compress($packed); # or with checksum my $compressed = compress_checksum($packed); # decompress my $decompressed = decompress($compressed); my @result = unpack('d*', $decompressed); # @result now contains the same values as @data did
$compressed = compress($data [, $level])
Uses the lz4frame library to compress the given data. The optional compression level is passed through to lz4frame.
Usage is the same as compress. The only difference is, that a checksum is included into the resulting data, which will be checked by decompress.
$data = decompress($compressed)
Decompresses the given data.
The format of the compressed data is incompatible to that of Compress::LZ4, thus they are not interoperable. Other than that this package should be compatible to every program/library working with the official lz4frame format.
LZ4 on Github
Interoperable LZ4 implementations
Felix Bytow <felix.bytow@autinity.de>
This software is copyright (c) 2015 by afr-consulting GmbH.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Compress::LZ4Frame, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Compress::LZ4Frame
CPAN shell
perl -MCPAN -e shell install Compress::LZ4Frame
For more information on module installation, please visit the detailed CPAN module installation guide.