An open API service indexing awesome lists of open source software.

https://github.com/propan/clj-lz77

an implementation of LZ77 compression algorithm written in Clojure
https://github.com/propan/clj-lz77

Last synced: 11 months ago
JSON representation

an implementation of LZ77 compression algorithm written in Clojure

Awesome Lists containing this project

README

          

# clj-lz77

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

## Usage

Include the library in your leiningen project dependencies:

```clojure
[clj-lz77 "0.1.0"]
```

## Examples

```clojure
(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:

```clojure
(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.