Skip to content

C++ CLI-based file and folder compression tool using Huffman encoding with a custom archive format.

License

Notifications You must be signed in to change notification settings

Pravar-Gupta/CoreZip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CoreZip

CoreZip is a C++ command-line file compression tool that implements a lossless compression pipeline using Huffman encoding.
It supports both single-file compression and folder-based archive compression, focusing on low-level compression mechanics, binary I/O, and bit-level data handling.


Current Version

  • Version: v0.9
  • Status: Core compression engine with folder/archive support
  • Algorithm: Huffman Encoding
  • Scope: Single-file and folder compression (archived)

Project Overview

CoreZip is designed as a modular compression engine built incrementally to explore how real-world compression tools work internally.

This version represents the foundational stage of the project, establishing a reliable Huffman-based pipeline along with basic archive handling for folders. The focus is on correctness and clarity rather than maximum compression efficiency.


Features (v0.9)

  • Lossless file compression using Huffman encoding
  • Folder compression via custom archive creation
  • Binary file input/output handling
  • Bit-level stream management for efficient encoding
  • Command-line interface for compression and decompression
  • Integrity-preserving decompression for files and archives

High-Level Workflow

File Compression

  1. Read input file in binary mode
  2. Analyze byte frequency distribution
  3. Build Huffman tree
  4. Encode data using variable-length codes
  5. Write compressed output with metadata

Folder Compression

  1. Traverse folder structure recursively
  2. Pack files into a custom archive format
  3. Compress archived data using Huffman encoding
  4. Restore original folder structure during decompression

Project Structure

CoreZip/
│
├── src/
│ ├── main.cpp
│ ├── huffman.h
│ ├── huffman.cpp
│ ├── bitstream.h
│ └── bitstream.cpp
│
├── data/
│ └── sample.txt
│
├── build/
│ └── (ignored)
│
└── README.md

Build Instructions (Windows / GCC)

This project is built and tested on Windows using GCC (MinGW).

Build

g++ src\main.cpp src\huffman.cpp src\bitstream.cpp -o build\compress.exe

Usage

Compress a single file

build\compress.exe compress file <input_file> <output_file>

Example:

build\compress.exe compress file data\sample.txt build\sample.huff

Decompress a file

build\compress.exe decompress <archive_file> <output_file>

Example:

build\compress.exe decompress build\sample.huff build\out

Compress a folder

build\compress.exe compress folder <input_folder> <output_archive>

Example:

build\compress.exe compress folder data\testFolder build\folder.huff

Decompress a folder archive

build\compress.exe decompress <archive_file> <output_folder>

Example:

build\compress.exe decompress build\folder.huff build\outputFolder

License

This project is released under the MIT License.

About

C++ CLI-based file and folder compression tool using Huffman encoding with a custom archive format.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages