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!
- 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.
- Select an algorithm: Huffman or Lempel–Ziv.
- Analyze file: Count character frequencies (Huffman) or find repeated phrases (LZ).
- Build Tree/Dictionary: Huffman builds prefix trees, LZ builds codebooks.
- Encode: Replace content with compressed codes.
- Decompress: Use stored metadata to restore original file, losslessly!
.txt
|.cpp
|.c
|.html
|.js
|.docx
| and more!
- 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!
git clone https://github.com/Jatin-Sharma-11/file_compressor_v2.git cd file_compressor_v2
Technology | Purpose |
---|---|
HTML | Web Interface |
C++ | Compression Logic (Huffman & LZ) |
Python | App Orchestration |
Docker | Containerization |
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.
- 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.
Stars | Watchers | Forks | Languages |
---|---|---|---|
⭐ 1 | 👀 1 | 🍴 0 | HTML (65.5%) |
Main Languages:
- C++ (compression & decompression)
- Python (app logic)
- HTML (web frontend)
- Dockerfile (containerization)
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!