Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dmazzella/ufastlz
Micropython wrapper for FastLZ, a lightning-fast lossless compression library
https://github.com/dmazzella/ufastlz
Last synced: 24 days ago
JSON representation
Micropython wrapper for FastLZ, a lightning-fast lossless compression library
- Host: GitHub
- URL: https://github.com/dmazzella/ufastlz
- Owner: dmazzella
- Created: 2021-10-06T13:42:14.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-06-11T13:52:17.000Z (over 2 years ago)
- Last Synced: 2024-04-22T12:32:52.326Z (8 months ago)
- Language: Python
- Homepage:
- Size: 7.81 KB
- Stars: 13
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-micropython - ufastlz - MicroPython wrapper for FastLZ, a lightning-fast lossless compression library. (Libraries / Communications)
README
ufastlz
=====Micropython wrapper for [FastLZ](https://github.com/ariya/FastLZ), a lightning-fast lossless compression library.
Compiling the cmodule into MicroPython
=====To build such a module, compile MicroPython with an extra make flag named ```USER_C_MODULES``` set to the directory containing all modules you want included (not to the module itself).
#### unix port
```bash
➜ ~ git clone https://github.com/micropython/micropython.git
➜ ~ cd micropython
➜ micropython (master) ✗ git clone https://github.com/dmazzella/ufastlz.git ports/unix/cmodules/ufastlz
➜ micropython (ufastlz) ✗ cd ports/unix/cmodules/ufastlz
➜ micropython (ufastlz) ✗ git submodule update --init
➜ micropython (ufastlz) ✗ cd ../../../../
➜ micropython (master) ✗ make -j8 -C mpy-cross && make -j2 -C ports/unix/ VARIANT="dev" USER_C_MODULES="$(pwd)/ports/unix/cmodules"
```#### stm32 port
```bash
~ git clone https://github.com/micropython/micropython.git micropython
➜ ~ cd micropython
➜ micropython (master) ✗ git submodule update --init
➜ micropython (master) ✗ git clone https://github.com/dmazzella/ufastlz.git ports/stm32/boards/PYBD_SF6/cmodules/ufastlz
➜ micropython (ufastlz) ✗ cd ports/stm32/boards/PYBD_SF6/cmodules/ufastlz
➜ micropython (ufastlz) ✗ git submodule update --init
➜ micropython (ufastlz) ✗ cd ../../../../../../
➜ micropython (master) ✗ make -j2 -C mpy-cross && make -j2 -C ports/stm32/ BOARD="PYBD_SF6" USER_C_MODULES="$(pwd)/ports/stm32/boards/PYBD_SF6/cmodules"
```Usage
=====```python
MicroPython v1.17-74-gd42cba0d2-dirty on 2021-10-06; PYBD-SF6W with STM32F767IIK
Type "help()" for more information.
>>> import _fastlz
>>> d = "test " * 100
>>> d
'test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test '
>>> c = _fastlz.compress(d)
>>> c
b'\x04test \xe0\xfd\x04\xe0\xdb\x04\x04test '
>>> _fastlz.decompress(c)
b'test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test '
>>>
```API
=====
- ```_fastlz.compress(data, level=2)```
- ```_fastlz.decompress(data, maxout=2048)```