Skip to content

File Compressor v2 is an advanced, user-friendly web application for compressing and decompressing files using both Huffman Coding and Lempel–Ziv (LZ77/LZW) algorithms. Designed with efficiency in mind, it enables lossless compression of text, code, and document files—saving disk space without sacrificing data integrity. With a sleek HTML interface

Notifications You must be signed in to change notification settings

Jatin-Sharma-11/file_compressor_v2

Repository files navigation

🗜️ File Compressor v2 — Huffman & Lempel–Ziv Compression! 🚀

Huffman Coding Lempel–Ziv HTML C++ Python Dockerfile


✨ Introduction

File Compressor v2 is a web application for compressing and decompressing files using the industry-standard Huffman Coding and Lempel–Ziv (LZ77/LZW) algorithms. Achieve efficient, lossless compression for your text and code files, saving valuable storage while preserving all your data!


🧠 Algorithms Supported

  • Huffman Coding: Assigns shortest binary codes to frequent characters. Excellent for text files.
  • Lempel–Ziv (LZ77/LZW): Uses dictionary encoding for repeated sequences—ideal for rapidly compressing all types of data!

Choose your preferred algorithm for the best results on different file types.


⚙️ How it Works

  1. Select an algorithm: Huffman or Lempel–Ziv.
  2. Analyze file: Count character frequencies (Huffman) or find repeated phrases (LZ).
  3. Build Tree/Dictionary: Huffman builds prefix trees, LZ builds codebooks.
  4. Encode: Replace content with compressed codes.
  5. Decompress: Use stored metadata to restore original file, losslessly!

📂 Supported File Types

  • .txt | .cpp | .c | .html | .js | .docx | and more!

🏆 Performance & Results

  • Test File (Huffman): 48.3MB → 25.8MB (~47% reduction!)
  • Decompression: Restores file with zero loss.
  • Lempel–Ziv: Fast dictionary-based encoding for text and binary files!

🚀 Quick Start

git clone https://github.com/Jatin-Sharma-11/file_compressor_v2.git cd file_compressor_v2


🛠️ Tech Stack

Technology Purpose
HTML Web Interface
C++ Compression Logic (Huffman & LZ)
Python App Orchestration
Docker Containerization

📚 Algorithm Steps

Huffman: 1️⃣ Build a frequency hashmap. 2️⃣ Create a minheap, build the Huffman tree. 3️⃣ Assign binary codes via tree traversal. 4️⃣ Map chars to codes and compress.

Lempel–Ziv: 1️⃣ Parse input into substrings. 2️⃣ Build codebook and assign codes for repeated phrases. 3️⃣ Generate compressed output using codebook.


💡 Notes

  • Compression is most effective for medium/large files.
  • C++ powers the core compression algorithms.
  • Tiny files (<500 bytes) may get slightly larger due to header/dictionary overhead.
  • Choose algorithm based on input type for optimal compression.

👥 Project Stats

Stars Watchers Forks Languages
⭐ 1 👀 1 🍴 0 HTML (65.5%)

Main Languages:

  • C++ (compression & decompression)
  • Python (app logic)
  • HTML (web frontend)
  • Dockerfile (containerization)

✍️ Conclusion

Huffman & Lempel–Ziv algorithms make your files smaller & safer—lossless, reliable, and fast!
Try File Compressor v2 and reclaim your disk space today.


Crafted with ❤️ by Jatin Sharma

Contributions, issues, and stars are welcome!

About

File Compressor v2 is an advanced, user-friendly web application for compressing and decompressing files using both Huffman Coding and Lempel–Ziv (LZ77/LZW) algorithms. Designed with efficiency in mind, it enables lossless compression of text, code, and document files—saving disk space without sacrificing data integrity. With a sleek HTML interface

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published