GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - vikstapolis/compression: Implementations of Huffman coding and LZ77 compression in Haskell

BranchesTags
Open more actions menu

Latest commit

 

History

5 Commits
5 Commits

Folders and files

NameName
Last commit message
Last commit date
app
app
 
 
src/Compression
src/Compression
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
compression.cabal
compression.cabal
 
 
hie.yaml
hie.yaml
 
 

Repository files navigation

Compression

Implementations of Huffman coding and LZ77 compression in Haskell.

The project contains implementations of:

  • Huffman encoding/decoding
  • LZ77 compression/decompression

Status

Archived project originally written in 2021 while learning Haskell.

How to run

cabal run

The current executable demonstrates the LZ77 implementation; the Huffman implementation is available in the source.

Example:

$ cabal run compression
This program compresses files using LZ77 encoding.
Enter the name of the file:
megabyte.txt
Do you want to COMPRESS or UNCOMPRESS the file?
compress
File megabyte.txt COMPRESSED.

$ cabal run compression
This program compresses files using LZ77 encoding.
Enter the name of the file:
megabyte.lz77
Do you want to COMPRESS or UNCOMPRESS the file?
uncompress
File megabyte.lz77 UNCOMPRESSED.

Implementation

Huffman coding

The Huffman implementation builds a binary Huffman tree from character frequencies and traverses the tree to generate variable-length prefix codes. The encoded bitstream is packed into bytes and the frequency table is stored alongside it so that the original file can be reconstructed during decoding.

LZ77

The LZ77 implementation uses a sliding-window scheme with a 15,000-byte search buffer and a 250-byte look-ahead buffer. Repeated substrings are represented as (distance, length) pairs, while short or non-repeated sequences are stored as individual bytes.

Two LZ77 implementations are included, using different data representations and substring-matching approaches. The second represents the input as an unboxed Vector Word8 rather than a ByteString and uses custom substring-matching routines.

About

Implementations of Huffman coding and LZ77 compression in Haskell

Topics

compression-algorithmhaskellhuffman-codinglz77

Resources

Readme
Activity

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.