GithubHelp home page GithubHelp logo

compressw's Introduction

Compression, based on the LZW compression algorithm.

This is my Windows port of the 1985 Revison 4.0 of the compress application, now bumped to Revision 4.1.

The first step was to add a CMakeLists.txt to do the building. This should allow the source to be built by a large number of tools, in a cross platform way.

Further I converted all functions from the original K&R style, to modern C style. Added more headers, and supplied forward reference such that is should compile without error or warnings, at least when using the MSVC compiler/linker, and in Ubuntu 14.04 LTS linux.

And some effort has been done to tidy up the indentation of the code, to make it more readable.

The building should be done in the 'build' folder. There is a build-me.bat / build-me.sh there to facilitate this. Your system may be missing some of the tools used in that batch file, but if you have cmake and msvc installed, then it should complete its job.

For those with building WIN64 capability, there is a build.x64 folder for this, again with a build-me.bat that first sets up the 64-bit build environment, then does the build. If you are not using MSVC10, or it is installed diffently, then this batch file may need some TLC.

But even if you do not use these batch files, the building is simple -

cd build
cmake ..
cmake --build . --config release

In *nix the 3rd line can just be 'make' if a unix makefile is the generator of your choice. Alternatively you can use the cmake GUI, setting the source folder, and the binary directory to the 'build' folder.

The project also produces btoa/atob sample applications, like uuencode/uudecode. Running btoa, and inputing a string will produce an encoded character string, plus an 'xbtoa End N ?? c ?....' sequences which can be passed to atob to decode back to the original string.

This wiki page gives more information, especially the history of using this algorithm. Of course during the years that unisys held the patent, gzip and bzip2 became the preferred compression tools, and they usually achieve a sometimes significant increased compression ratio.

But compress still works, and on a simple ascii file usually achieves a 40-50% compression ratio.

Enjoy.

Geoff. 20140826

compressw's People

Contributors

geoffmcl avatar

Watchers

 avatar  avatar  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.