Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/synodriver/lua-huffman

huffman encode and decode for lua
https://github.com/synodriver/lua-huffman

huffman lua

Last synced: 18 days ago
JSON representation

huffman encode and decode for lua

Awesome Lists containing this project

README

        

✨ lua-huffman ✨


The lua binding for huffman

### huffman compress and decompress for lua

- usage
```
hfm = require("hfm")

data = "1234"

for i = 1, 10 do
data = data .. data
end
print("origin len : " .. #data)
encoded = hfm.encode(data)
print("encoded len : " .. #encoded)
print(hfm.decode(encoded))

hfm.encode_file("Makefile", "Makefile.bin")
hfm.decode_file("Makefile.bin", "Makefile.txt")
```