https://github.com/rsheremeta/archiver
archiver written in Go (Golang) implements Shannon-Fano algorithm for text data compression
https://github.com/rsheremeta/archiver
data-compression go golang shannon-fano shannon-fano-algorithm
Last synced: about 11 hours ago
JSON representation
archiver written in Go (Golang) implements Shannon-Fano algorithm for text data compression
- Host: GitHub
- URL: https://github.com/rsheremeta/archiver
- Owner: RSheremeta
- Created: 2022-06-19T17:29:12.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-06-20T11:28:51.000Z (about 3 years ago)
- Last Synced: 2025-02-26T19:41:05.205Z (4 months ago)
- Topics: data-compression, go, golang, shannon-fano, shannon-fano-algorithm
- Language: Go
- Homepage:
- Size: 86.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# archiver
#### A tiny archiver for text data compression using [Shannon-Fano][sf-wiki] algorithm
Most valuable to large data.
Supported formats:
- ``txt`` to ``txt``
- ``txt`` to ``rtf``
- ``rtf`` to ``txt``
- ``rtf`` to ``rtf``### Usage
There are two ways:
- Clone the repo and build the project using ``go build``
- Download a released binary [here][bin]#### Archiving
1. ``./archiver pack --method sf `` or shorted ``./archiver pack -m sf ``
2. This will generate a new compressed file with ``.sf`` extension#### Unarchiving
1. ``./archiver unpack --method sf `` or shorted ``./archiver unpack -m sf ``
2. Optional flag: ``--extension`` or ``-e`` used for decompressing target file to a specific extension
3. Available options: ``txt``(default), ``rtf``
4. This will generate a new decompressed file#### Examples
Feel free to play around with files in the ``/examples`` dir#### Efficiency
Depending on a data content compression efficiency could be up to 60%.Compression and decompression results:

[sf-wiki]: https://en.wikipedia.org/wiki/Shannon%E2%80%93Fano_coding
[bin]: https://github.com/RSheremeta/archiver/releases/tag/1.0