Skip to main content

Compress

Tips#

  • google/zopfli
    • Zopfli Compression Algorithm is a compression library programmed in C to perform very good, but slow, deflate or zlib compression.
  • google/brotli
    • 通用无损压缩
    • combination of a modern variant of the LZ77 algorithm, Huffman coding and 2nd order context modeling, with a compression ratio comparable to the best currently available general-purpose compression methods
    • 速度与 deflate 相似, 但压缩率更高
    • kothar/brotli-go
      • Go bindings for the Brotli compression library
  • google/draco
    • Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
  • dsnet/compress
    • Collection of compression related Go packages.
  • facebook/zstd
    • zstd
    • Zstandard - Fast real-time compression algorithm
  • Benchmark
  • JS
    • nodeca/pako
      • high speed zlib port to javascript, works in browser & node.js
  • pigz - 并行 Gzip - 命令兼容 gzip
cd staged && mytar cf - . | ssh [email protected] "cd / && tar xvf -"
# bz2# ==========# 解压bzip2 -d filename.bz2# 解压并保留原始压缩包bzip2 -dk filename.bz2
# 并行 Gzip# http://zlib.net/pigz/# 提亚提升不大, 因为解压的结构不适用于并发# 支持 -11 zopfli# 利用 pv 可以查看压缩进度pv dict.db | pigz -vfk9 > dict.db.gz
# 可以直接替换ln -s /usr/bin/pigz /usr/local/bin/gzipln -s /usr/bin/unpigz /usr/local/bin/gunzip
# 强制覆写, 暴露原始文件, 9 级压缩gzip -vfk9 data.db > data.db.gz
# -w 0 自动选择优化的窗口大小# -9 压缩率, 如果不指定, 默认为 -Z 即 11, 会非常慢pv dict.db | brotli -9 -w 0 > dict.db.br
# 编码# ====# https://www.iana.org/assignments/character-sets/character-sets.xhtml# 使用指定的编码, 有些 unzip 不一定有该选项unzip -O cp936 -l my.zip# 也可以先解压, 然后再转换LANG=C 7za x your-zip-file.zipconvmv -f GBK -t utf8 --notest -r .# brew install unarunar -e gb18030 gb18030.zip
# 批量# ====unzip \*.zip

gzip#