Vendors upstream zstd without any modifications.
Optimized for speed. The API may be easily used in zero allocations mode.
Decompress*functions are optimized for high concurrency.
Proper Writer.Flush for network apps.
Supports the following features from upstream zstd:
- Block / stream compression / decompression with all the supported compression levels and with dictionary support.
- Dictionary building from a sample set. The created dictionary may be saved to persistent storage / transfered over the network.
- Dictionary loading for compression / decompression.
Pull requests for missing upstream
zstdfeatures are welcome.
How to install
go get -u github.com/valyala/gozstd
How to compress data?
The easiest way is just to use Compress:
compressedData := Compress(nil, data)
How to decompress data?
The easiest way is just to use Decompress:
data, err := Decompress(nil, compressedData)
Q: Which go version is supported?
go1.10and newer. Pull requests for older go versions support are accepted.
Q: Which platforms/architectures are supported?
windows/amd64. Pull requests for other platforms/architectures support are accepted.
Q: I don't trust
libzstd*.abinary files from the repo or these files dont't work on my OS/architecture. How to rebuild them?
A: Just run
make clean libzstd.aif your OS/architecture is supported.
Q: Why the repo contains
A: This simplifies package installation to usual
go getwithout additional steps for building the