Code Monkey home page Code Monkey logo

minizip's Introduction

Minizip zlib contribution that includes:

  • AES encryption
  • I/O buffering
  • PKWARE disk spanning
  • Visual Studio 2008 project files

It also has the latest bug fixes that having been found all over the internet including the minizip forum and zlib developer's mailing list.

AES Encryption

  • Requires #define HAVE_AES
  • Requires AES library files

When zipping with a password it will always use AES 256-bit encryption. When unzipping it will use AES decryption only if necessary. Does not support central directory or local file header encryption.

I/O Buffering

Improves I/O performance by buffering read and write operations.

zlib_filefunc64_def filefunc64 = {0};
ourbuffer_t buffered = {0};
    
fill_win32_filefunc64(&buffered->filefunc64);
fill_buffer_filefunc64(&filefunc64, buffered);
    
unzOpen2_64(filename, &filefunc64)

PKWARE disk spanning

To create an archive with multiple disks use zipOpen3_64 supplying a disk_size value in bytes.

extern zipFile ZEXPORT zipOpen3_64 OF((const void *pathname, int append, 
  ZPOS64_T disk_size, zipcharpc* globalcomment, zlib_filefunc64_def* pzlib_filefunc_def));

The central directory is the only data stored in the .zip and doesn't follow disk_size restrictions.

When unzipping it will automatically determine when in needs to span disks.

I/O Memory

To unzip from a zip file in memory use fill_memory_filefunc and supply a proper ourmemory_t structure.

zlib_filefunc_def filefunc32 = {0};
ourmemory_t unzmem = {0};

unzmem.size = bufsize;
unzmem.base = (char *)malloc(unzmem.size);
memcpy(unzmem.base, buffer, unzmem.size);
    
fill_memory_filefunc(&filefunc32, &unzmem);

unzOpen2("__notused__", &filefunc32);

To create a zip file in memory use fill_memory_filefunc and supply a proper ourmemory_t structure. It is important not to forget to free zipmem->base when finished. If grow is set, zipmem->base will expand to fit the size of the zip. If grow is not set be sure to fill out zipmem.base and zipmem.size.

zlib_filefunc_def filefunc32 = {0};
ourmemory_t zipmem = {0};

zipmem.grow = 1;

fill_memory_filefunc(&filefunc32, &zipmem);

zipOpen3("__notused__", APPEND_STATUS_CREATE, 0, 0, &filefunc32);

BZIP2

  • Requires #define HAVE_BZIP2
  • Requires BZIP2 library

Apple libcompression

  • Requires #define HAVE_APPLE_COMPRESSION

Windows RT

  • Requires #define IOWIN32_USING_WINRT_API

minizip's People

Contributors

nmoinvaz avatar asmaloney avatar coeur avatar mschmieder avatar wangp avatar matthew1471 avatar lindleyf avatar nadeemahd avatar stevenchristy avatar woutervd avatar zett42 avatar senn412 avatar luciocosmo avatar emvivre avatar 0-wiz-0 avatar mati865 avatar neolit123 avatar inequation avatar jlawton avatar gvollant avatar franiu avatar kant avatar abaumgaertner avatar

Watchers

James Cloos avatar Andrey A. Ugolnik avatar

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.