Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.
/ jlzf Public archive

Janet Module providing LZF (de)compression.

License

Notifications You must be signed in to change notification settings

MorganPeterson/jlzf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NOTICE

I am moving all future work to Sourcehut and this repository is now archived.

JLZF

A Janet native module that allows for use of liblzf

Liblzf is a very small data compression library.

liblzf

All the files need are already bundled inside this repository. No need to download.

Liblzf has it's own very permissive license that can be found in the liblzf-3.6 directory.

There are no known patents involved.

Original files can be found here: dist.schmorp.de

install

sudo jpm install https://github.com/MorganPeterson/jlzf

example

The test.janet file in the test directory should give you some idea of the workings.

(import jlzf)

(def text (string/slice (slurp "test.txt")))

# compress returns true for success; otherwise returns false.
(cond (jlzf/compress "test.lzf" text)
  (print "success")
  (print "failure"))

# decompress returns a string
(print (jlzf/decompress "test.lzf"))

Caveat

Compression fails on files that are 17 bytes or less. If you have to compress something that small... well, may the gods help you.

About

Janet Module providing LZF (de)compression.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published