Skip to content
A command-line utility for quickly compressing or decompressing zlib data.
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmd/zlib
README.md Name changed to just zlib; No base64-stuff (single resp. principle) Sep 18, 2015
go.mod go mod init Apr 12, 2019
go.sum go mod init Apr 12, 2019

README.md

zlib

I couldn't find a command-line tool for decompressing and compressing zlib data, so I wrote my own. That's about the long and short of it.

Installation

go get -u github.com/kevin-cantwell/zlib/cmd/zlib

Usage

Without any arguments, zlib will compress an input stream. Use the -d flag for decompression.

NAME:
   zlib - A wrapper for the zlib compression algorithm.

USAGE:
   zlib [global options] command [command options] [arguments...]

VERSION:
   0.0.0

COMMANDS:
   help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   -d, --decompress Decompresses the input instead of compressing the output.
   --help, -h       show help
   --version, -v    print the version

Examples

Compressing a file

zlib < file > file.zlib

Decompressing a zlib-compressed file

zlib -d < file.zlib

Compressing and base64-encoding some json

echo -n '{"foo":"bar"}' | zlib | base64

Outputs: eJyqVkrLz1eyUkpKLFKqBQQAAP//HXoENA==

Decoding and decompressing some base64-encoded and zlib-compressed input

echo -n 'eJyqVkrLz1eyUkpKLFKqBQQAAP//HXoENA==' | base64 -D | zlib -d

Outputs: {"foo":"bar"}

You can’t perform that action at this time.