klauspost/compress

Public

Optimized Go Compression Packages

  • Stars5.7k+11 tuần này
  • Forks423
  • Watchers63
  • Issues4
  • Ngày tạo22/07/2015
  • Cập nhật gần nhất26/10/2026
  • Ngôn ngữGo
  • Giấy phép—
README.md104.9 KBRaw

compress

This package provides various compression algorithms.

  • zstandard compression and decompression in pure Go.
  • S2 is a high performance replacement for Snappy.
  • Optimized deflate packages which can be used as a dropin replacement for gzip, zip and zlib.
  • snappy is a drop-in replacement for github.com/golang/snappy offering better compression and concurrent streams.
  • lzw is a drop-in replacement for compress/lzw with 1.4-4x faster decompression and 1.1-2.7x faster compression, depending on the data.
  • huff0 and FSE implementations for raw entropy encoding.
  • Xpress decompression of the Microsoft XPRESS (MS-XCA) plain LZ77 and LZ77+Huffman formats (the LZ77+Huffman variant is the one used in WIM images and Windows Compact OS / WOF data).
  • gzhttp Provides client and server wrappers for handling gzipped/zstd HTTP requests efficiently.
  • pgzip is a separate package that provides a very fast parallel gzip implementation.

Go Reference Go Sourcegraph Badge

package usage

Use go get github.com/klauspost/compress@latest to add it to your project.

This package will support the current Go version and 2 versions back.

  • Use the nounsafe tag to disable all use of the "unsafe" package.
  • Use the noasm tag to disable all assembly across packages.

Use the links above for more information on each.

changelog

  • Sep 25th, 2026 1.20.1

    • zstd: Apply reset options to reused frame decoders by @pellared in #1226
    • flate: Report unexpected EOF for truncated Huffman extra bits by @rupayon123 in #1229
    • flate: Avoid FMA in EstimatedBits for portable rounding by @malt3 in #1224
    • gzhttp: Preserve caller request headers in Transport by @jakezwang in #1225
    • gzhttp: Only decompress a request when gzip is the outermost coding by @youdie006 in #1223
    • zstd/huff0: Optimizations by @lizthegrey in #1203 #1205 #1207 #1204 #1208 #1211 #1209 #1210
    • flate: Speed improvements by @alex in #1220 #1218 #1216 #1215 #1214 #1217
  • Sep 2nd, 2026 1.20.0

    • lzw: Add lzw reader/writer in #1189
    • xpress: Add Microsoft XPRESS (MS-XCA) decompression by @MP-GOWTHAM in #1195

Nội dung README thuộc về klauspost và cộng đồng đóng góp, giấy phép Không có giấy phép. Nguồn: github.com/klauspost/compress