Library for compression algorithm

Saskia
Posts: 40
Joined: Mon Jun 26, 2017 11:45 am

Library for compression algorithm

Postby Saskia » Mon Jun 26, 2017 11:47 am

Hello,

is there a library for compression algorithm? I want to use huffman (or any other) kind of algorithm to compress my data.
I have a lot of hex values like

Code: Select all

49 00 06 00 37 2A 00 01
20 DD 09 00 10 18 02 01
These values should be compressed, before storing them, so the file size is way less.

- Saskia

ESP_igrr
Posts: 2067
Joined: Tue Dec 01, 2015 8:37 am

Re: Library for compression algorithm

Postby ESP_igrr » Mon Jun 26, 2017 11:59 am

ESP32 ROM code contains some functions from miniz compression library: rom/miniz.h.

Miniz has a number of APIs, but the ones which are available in the ROM are the low-level tdefl_*/tinfl_* compression and decompression functions.

User avatar
loboris
Posts: 514
Joined: Wed Dec 21, 2016 7:40 pm

Re: Library for compression algorithm

Postby loboris » Mon Jun 26, 2017 12:46 pm

You can use zlib library (https://github.com/madler/zlib).
Copy only the *.c & *.h files from root directory. I't compiles without problems.
You can find an example in https://github.com/loboris/ESP32_curl_example, components/zlib directory.

Saskia
Posts: 40
Joined: Mon Jun 26, 2017 11:45 am

Re: Library for compression algorithm

Postby Saskia » Mon Jun 26, 2017 4:54 pm

Hello,

thanks. I will try the zlib library.

- Saskia

snahmad75
Posts: 445
Joined: Wed Jan 24, 2018 6:32 pm

Re: Library for compression algorithm

Postby snahmad75 » Tue Jun 19, 2018 1:06 pm

https://github.com/madler/zlib is not building on esp32

Have any one manage to uncompress any zip format file include all sub folder into folder on esp32.

Thanks,
Naeem

jubueche
Posts: 32
Joined: Sat Jan 19, 2019 4:03 pm

Re: Library for compression algorithm

Postby jubueche » Thu Feb 07, 2019 3:56 pm

I had to add #include <unistd.h> to gzread and gzwrite. Also, I added #include <unistd.h> and #include <sys/types.h> to gzlib.c

It compiled afterwards. Don't forget to put header files in components/zlib/include and c files in components/zlib/

Who is online

Users browsing this forum: No registered users and 107 guests