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
- Run
bash build-on-manylinux.sh
- run
setup.py bdist_wheel
with every cpython version you want from/opt/python
Changelog
1.3
- decompress support for files > 0xFFFFFF (found in SSHD)
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 Distribution
Built Distributions
Hashes for nlzss11-1.4-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 764a24fc09c824881e86dc7bebef05f7d7c6874b1e2b13fa6fe3f5cae8c8c4bc |
|
MD5 | df9fba1b04dfeb93227464f2659683c7 |
|
BLAKE2b-256 | f990d4e4a191aec87fd9996deafe602aaa70eae8911a663f6a97c21524e003c2 |
Hashes for nlzss11-1.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31c82d9ba41c47e3d39e53c42bc36a32f0415506dc796266724a4b4479d6d2df |
|
MD5 | 4c7a6a1fd16c86751f658e664a574252 |
|
BLAKE2b-256 | 21489f168be9423482d04e8ad072fb027dde3f81e9f4d2150d041990d67d5ca7 |
Hashes for nlzss11-1.4-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f69621ea7102c79641a8b91d16b6bcaf0fc6bd807cc1b2a3e540b80a5f79c4da |
|
MD5 | 9587dbddcb84140e4ede6d309c258b6c |
|
BLAKE2b-256 | d1b730ff61dc5cdb1e4c67ed39660d200b4931afe3119800dc9ee7c7ea283960 |
Hashes for nlzss11-1.4-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2cc8398f8b0052233d09338ad045a3182e8f1a60a600d3f6ed4365e71a63486a |
|
MD5 | b08da4395720041793fe9e7a0b77f77a |
|
BLAKE2b-256 | 3b10945cb3273eb5c2d4ae9a9de81c19f3be8d6ed434364ad7e83338e5ea1cde |
Hashes for nlzss11-1.4-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5aeb1bab3182e0f68308cefa77311c45602e83477243a150896241d7a068ad31 |
|
MD5 | d5366f212220f64d371fe172f9f6cc77 |
|
BLAKE2b-256 | 0104aaa2d0f578fdf27615753f6f5e47d136b7ae7f2edc3d68535a93249b62bd |
Hashes for nlzss11-1.4-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc80c6a029a5c2a119fb18d5ef8a42665fe844b5e828d04e24fba582b345bcb9 |
|
MD5 | 96a151b5999be46ad3fee4a8ea753521 |
|
BLAKE2b-256 | 1d563694a06793cea29106f7d78b323a3b549f77147a81a214ad3d7d3d489883 |
Hashes for nlzss11-1.4-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a67785a9505219a8800a0ef56a7acf87338d9e87cff4d5c4e3eb24dfc09e8661 |
|
MD5 | d1db5871b2bc634c2bc7384f5101a4cc |
|
BLAKE2b-256 | 573b9bd164d6ea3d8b1d66a10aa206a0b255f0b6c55649b94e6e019f8bf584d2 |
Hashes for nlzss11-1.4-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f9e0f863fc7617bb092457133eed9175e644a54b3e0537501baa63709e74823 |
|
MD5 | 37971cdba01f196f1d76a13d155425bb |
|
BLAKE2b-256 | c230382eb909e8fd7cd84b7e6a7ca3bb1147843c85d4aaa3d4942a4b25f676ca |
Hashes for nlzss11-1.4-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 715e255839c8371e98658538caaa8c063df956f1f1a1df88a62dfd41b1c3a92d |
|
MD5 | ef7d57eabcc8bfdcd0c56e26bd35e006 |
|
BLAKE2b-256 | b69c889b37d2a5a6661c3368d5cd9190234383a58124a320229ad9946fc777f3 |
Hashes for nlzss11-1.4-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3be63ebbebab76cf1a46eeb713e52536c159a68813a76f4eb5f25250255f0f18 |
|
MD5 | 42d2fbcd56b070f4a26487e1379a3a38 |
|
BLAKE2b-256 | cde06b67dc44eea297cd8a68012c1dd3f7388e875721c02ab938235174781084 |
Hashes for nlzss11-1.4-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3feb4f91250ddd6478b0409605e3ca9bcdd65072b41f9e1f39e8165b27856c47 |
|
MD5 | 3a703a5a128fab644209bee61bbc1517 |
|
BLAKE2b-256 | 511513dfdca32bc01e8f4765f79f7068824d553142f91058dc08661e81d3b3af |
Hashes for nlzss11-1.4-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c14c8b91d1aaa28f528f70455cadbe1eac4e660ce51c8d3d664aef713643df54 |
|
MD5 | 203b71560de77b988b81262cee422f06 |
|
BLAKE2b-256 | 605d5708e32bce514dc7718150bc09b22e5704630141d37d3014eaf256445848 |
Hashes for nlzss11-1.4-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 75218ad195a08baf019b295ae870adcb1e12911c3f60eaee1ff3a5ade5fa5109 |
|
MD5 | 7859eccda9b2cc765c76623efe64e1cb |
|
BLAKE2b-256 | f83366b8f9ddf7cbf93490df68fa47f3fd2c3519be23e90fc0dff7948a9f2b87 |