Skip to content

A command-line utility for quickly compressing or decompressing zlib data.

Notifications You must be signed in to change notification settings

Magnusjensaas/zlib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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"}

About

A command-line utility for quickly compressing or decompressing zlib data.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%