Library for data (de)compression using Nintendo's lzss11 algorithm
Project description
nlzss11
Library for data compression using Nintendo's variant of the lzss algorithm
Reference implementation: nlzss
Usage
nlzss11 can be installed with pip3 install nlzss11
.
nlzss11.get_uncompressed_size(data)
Returns the size in bytes of the file if uncompressed or None if the bytes are not a valid Nintendo LZSS 11 compressed file
nlzss11.decompress(data)
Decompresses Yaz0-compressed data from a bytes-like object data
. Returns a bytes object containing the uncompressed data.
nlzss11.decompress_unsafe(data)
Decompresses Yaz0-compressed data from a bytes (not bytes-like) object data
. Returns a bytes object containing the uncompressed data.
Unlike nlzss11.decompress, this function assumes that the input data is well-formed. In exchange for slightly improved performance, no sanity checks are performed. Warning: Do not use on untrusted data.
nlzss11.compress(data, level=7)
Compresses a bytes-like object data
. Returns a bytes-like object containing the compressed data.
level
is the compression level (6-9). 6 is fastest and 9 is slowest. Higher compression levels result in better compression. 7 is a good compromise between compression ratio and performance.
Project information
This project is a fork from the amazing syaz0 Project, just modified to match the algorithm found in The Legend of Zelda: Skyward Sword.
Building from source
Building nlzss11 from source requires:
- CMake 3.10+
- A compiler that supports C++17
- Everything needed to build zlib-ng
- pybind11 2.4+ (including CMake config files)
- setuptools
When no binary build is available, pip will automatically build from source during the install process.
To build and install from source run pip3 install .
.
Building for manylinux
- Use the manylinux docker container in this directory:
docker run -v $PWD:/home/build/nlzss11 -ti quay.io/pypa/manylinux2010_x86_64 bash
- Install cmake3 via yum and override old cmake
- Install pybind11 from source
- run
setup.py bdist_wheel
with every cpython version you want from/opt/python
License
This software is licensed under the terms of the GNU General Public License, version 2 or later.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Hashes for nlzss11-1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58c7fbde0a433d64103594401b869ab2ad1c4b79a34dc447cb2677e6da2428f5 |
|
MD5 | 849c05a58f4a32121e78549b1426fb29 |
|
BLAKE2b-256 | 42ab9ac31f8a6692f0ed2ae9b5caad3daa0ecde6538c0b28a74c4cc1c0b4f1a1 |
Hashes for nlzss11-1.2-cp39-cp39-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4ad7cacaac20add43db90349de4a3ae887cbf7e8dc0a885f326eab9d8928dec |
|
MD5 | 57d3f0b82231bde5f5d572316163af5c |
|
BLAKE2b-256 | 80b08d0631b24f96148d07a20fab28c62bcc33ed4747e6ece9c798198b118e36 |
Hashes for nlzss11-1.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee293863315f83564751d134fad53dbfae4401601ff6b92f64ca8007c5a84deb |
|
MD5 | b8fadc91b509ce2a4187470f7106fec6 |
|
BLAKE2b-256 | c711c9db0abc2bb3ba5b87cfa37db60a0cbb89221f2c839aba7a7925a533daa6 |