Git Product home page Git Product logo

zchunk

Coverity Scan Build StatusFOSSA Status
GitHub Actions Test Status

zchunk is a compressed file format that splits the file into independent chunks. This allows you to only download changed chunks when downloading a new version of the file. Files can hosted on any web server that supports HTTP ranged requests, with no special software required to serve the files (though to download only the changed chunks, your client must be zchunk-aware).

zchunk files are protected with strong checksums to verify that the file you downloaded is, in fact, the file you wanted.

As of zchunk-1.0, the ABI and API have been marked stable, and the only changes allowed are backwards-compatible additions

Installation

To build and install zchunk, first install meson and run

meson build
cd build
ninja
ninja test
sudo ninja install

If you're building on an operating system where some libraries are stored in /usr/local, you'll need to replace meson build above as follows:

CFLAGS=-I/usr/local/include CXXFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib meson build

Using the utilities

To decompress a zchunk file, simply run:

unzck <filename>

To compress a new zchunk file, run:

zck <filename>

To download a zchunk file, run:

zckdl -s <source> <url of target>

To read a zchunk header, run:

zck_read_header <file>

Zchunk dictionaries

By default, each chunk in a zchunk file is compressed independently. However, if you're creating a zchunk file that has any repetitive data, you may be able to reduce the overall file size by using a zstd dictionary. The dictionary takes up extra space at the beginning of the zchunk file, but is used as an identical initial dictionary for compressing each chunk, which can give a significant overall savings.

It is important that all further revisions of the zchunk file use the same dictionary. If the dictionary changes, none of the chunks will match from the old file, and the full new file will be downloaded.

Zchunk can use any zstd dictionary, but also includes a utility to generate the ideal zstd dictionary for a zchunk file.

To create an ideal dictionary for a zchunk file, run:

zck_gen_zdict <file.zck>

The dictionary will be saved as <file.zdict>.

You will then need to recompress the file with the dictionary:

zck -D <uncompressed file>

Note that zck_gen_zdict does require that the zstd binary be installed on your system.

Documentation

License

FOSSA Status

zchunk's Projects

zchunk icon zchunk

A file format designed for highly efficient deltas while maintaining good compression

zchunk-java icon zchunk-java

A java-native implementation of the zchunk file format

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.