Skip to content

an implementation of LZ77 compression algorithm written in Clojure

Notifications You must be signed in to change notification settings

propan/clj-lz77

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

clj-lz77

A Clojure library that performs compression/decompression using LZ77 algorithm.

Usage

Include the library in your leiningen project dependencies:

[clj-lz77 "0.1.0"]

Examples

(use 'clj-lz77.core)

; to compress a file
(compress-file "/tmp/my-big-file.md" "/tmp/my-small-file.lz77")

; to decompress a file
(decompress-file "/tmp/my-small-file.lz77" "/tmp/my-big-file.md")

You can also use encode and decode functions that operate on a sequence level:

(use 'clj-lz77.encoder 'clj-lz77.decoder)

(def v [88 89 95 101 89 95 101 83 15])

; produces a lazy encoded sequence of bytes
(def e (encode v))

; produces a lazy decoded sequence of bytes
(def d (decode e))

(= v d) ; true, right?

License

Copyright © 2013 Pavel Prokopenko

Distributed under the Eclipse Public License, the same as Clojure.

About

an implementation of LZ77 compression algorithm written in Clojure

Resources

Stars

Watchers

Forks

Packages