gozstd - go wrapper for zstd
-
Vendors upstream zstd without any modifications.
-
Optimized for speed. The API may be easily used in zero allocations mode.
-
Compress*andDecompress*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.
go get -u github.com/valyala/gozstd
The easiest way is just to use Compress:
compressedData := Compress(nil, data)There is also StreamCompress and Writer for stream compression.
The easiest way is just to use Decompress:
data, err := Decompress(nil, compressedData)There is also StreamDecompress and Reader for stream decompression.
-
Q: Which go version is supported?
A:go1.10and newer. Pull requests for older go versions are accepted. -
Q: Which platforms/architectures are supported?
A:linux/amd64,linux/arm,linux/arm64,darwin/amd64,windows/amd64. Pull requests for other platforms/architectures are accepted. -
Q: I don't trust
libzstd*.abinary files from the repo or these files dont't work on my OS/ARCH. How to rebuild them? A: Just runmake clean libzstd.aif your OS/ARCH is supported. -
Q: Why the repo contains
libzstd*.abinary files?
A: This simplifies package installation to usualgo getwithout additional steps for building thelibzstd*.a