Page 1 of 1
Library for compression algorithm
Posted: Mon Jun 26, 2017 11:47 am
by Saskia
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
Re: Library for compression algorithm
Posted: Mon Jun 26, 2017 11:59 am
by ESP_igrr
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.
Re: Library for compression algorithm
Posted: Mon Jun 26, 2017 12:46 pm
by loboris
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.
Re: Library for compression algorithm
Posted: Mon Jun 26, 2017 4:54 pm
by Saskia
Hello,
thanks. I will try the zlib library.
- Saskia
Re: Library for compression algorithm
Posted: Tue Jun 19, 2018 1:06 pm
by snahmad75
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
Re: Library for compression algorithm
Posted: Thu Feb 07, 2019 3:56 pm
by jubueche
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/