https://github.com/iamsdas/text-compression
This is a simple text compression utility using the lzw algorithm in c++
https://github.com/iamsdas/text-compression
cpp file-compression lzw text-compression
Last synced: about 1 year ago
JSON representation
This is a simple text compression utility using the lzw algorithm in c++
- Host: GitHub
- URL: https://github.com/iamsdas/text-compression
- Owner: iamsdas
- Created: 2021-05-17T08:01:50.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-31T16:09:44.000Z (about 5 years ago)
- Last Synced: 2025-02-14T09:41:38.719Z (over 1 year ago)
- Topics: cpp, file-compression, lzw, text-compression
- Language: C++
- Homepage:
- Size: 12.7 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Text-Compression
This is a simple text compression utility using the LZW algorithm in c++.
# About
This program takes in inputs for `input file name`, `output file name` and whether or not to `compress or decompress`. It compresses standard text files into compressed binary files and decompresses compressed binary files to standard text file. It uses an optimized LZW algorithm which resets its dictionary on approaching its limit. The LZW compression works by reading a sequence of characters, grouping the characters `(8-bit)` into strings, and converting the strings into codes `(16-bit in this case)`. As the codes take up less space than the strings they replace, we get compression.
# Setup
```
# Clone the repo:
https://github.com/iamsdas/Text-Compression.git
# Open directory:
cd Text-Compression
# Compile the files:
g++ *.cpp -o lzw
```
# Examples:
## Compression
```
./lzw
c
demo.txt
compressed.bin
```
## Decompression
```
./lzw
d
compressed.bin
decompressed.txt
```
After successfull compression/decompression it will show the number of characters read and number of characters written