1Compress::Stream::Zstd(U3spemr)Contributed Perl DocumentCaotmiporness::Stream::Zstd(3pm)
2
3
4
6 Compress::Stream::Zstd - Perl interface to the Zstd (Zstandard)
7 (de)compressor
8
10 This module is a fork of Compress-Zstd
11 <https://github.com/spiritloose/Compress-Zstd>. It contains a few
12 changes to make streaming compression/uncompression more robust. The
13 only reason for this fork is to allow the module to work with
14 `IO-Compress-Zstd`. The hope is that the changes made here can be
15 merged back upstream and this module can be retired.
16
18 use Compress::Stream::Zstd;
19
20 my $compressed = compress($bytes);
21 my $decompressed = decompress($compressed);
22
24 The Compress::Stream::Zstd module provides an interface to the Zstd
25 (de)compressor.
26
28 compress($source [, $level])
29 Compresses the given buffer and returns the resulting bytes. The input
30 buffer can be either a scalar or a scalar reference.
31
32 On error undef is returned.
33
34 decompress($source)
35 uncompress($source)
36 Decompresses the given buffer and returns the resulting bytes. The
37 input buffer can be either a scalar or a scalar reference.
38
39 On error (in case of corrupted data) undef is returned.
40
42 ZSTD_VERSION_NUMBER
43 ZSTD_VERSION_STRING
44 ZSTD_MAX_CLEVEL
45 ZSTD_MIN_CLEVEL
47 <http://www.zstd.net/>
48
50 Copyright (c) 2016, Jiro Nishiguchi
51 All rights reserved.
52
53 Redistribution and use in source and binary forms, with or without modification,
54 are permitted provided that the following conditions are met:
55
56 1. Redistributions of source code must retain the above copyright notice, this
57 list of conditions and the following disclaimer.
58
59 2. Redistributions in binary form must reproduce the above copyright notice,
60 this list of conditions and the following disclaimer in the documentation
61 and/or other materials provided with the distribution.
62
63 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
64 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
65 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
66 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
67 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
68 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
69 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
70 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
71 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
72 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
73
75 Jiro Nishiguchi <jiro@cpan.org>
76
77 Some streaming enhancement by Paul Marquess <pmqs@cpan.org>
78
79 Zstandard by Facebook, Inc.
80
81
82
83perl v5.38.0 2023-07-20 Compress::Stream::Zstd(3pm)