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.5-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9466a10d395f25c1cbed69fc6c526fcf3304ca9f5d0894b19540ec6d2667cfae |
|
MD5 | b5ed8aab501d1ebdd80d41d2d28784e8 |
|
BLAKE2b-256 | 0ee59c97c59fdeebd9019471d96d31862972d9fc349934e0837d2deb2c107217 |
Hashes for nlzss11-1.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae6383c57a304112f01a6d23b9cd2f27a0ede424da7cffc725de864367e9f9d0 |
|
MD5 | d84196c4e285a3e297505e5fa46a6835 |
|
BLAKE2b-256 | 987a7378b0306998c85ed2a88af397fff25f0c3d69d10ef60b0c1a9b6c727959 |
Hashes for nlzss11-1.5-cp312-cp312-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f6920b636de5f5d7f9862998ec8e7818cb7d06d0039c98c196596d270194177b |
|
MD5 | a61974c55b32870c7aa4f6686be6c8ac |
|
BLAKE2b-256 | 44478ca2d1da69bbb25407f53e88266c22318b06c79e0c6edc4d61ff76df8914 |
Hashes for nlzss11-1.5-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fb273117c390c52a5f3a674e7cf81fa0aff6e84f0de79e06b84f47abe9e53f9 |
|
MD5 | 785b5086de650ca62d5bb08a7e8e852f |
|
BLAKE2b-256 | 06a7f4028cc24054b7f48244033d16d5fd862abcbbf494956e00e252febbcca2 |
Hashes for nlzss11-1.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c38c6c3346b0118641623442b311e1abf007cf81dfdaa5f67541fd2cdd2be0f4 |
|
MD5 | dd8659a2d8abe9fedb3ce4c5c7a59668 |
|
BLAKE2b-256 | ef8f169701640a56177afbf8e4bb38c1703bee378a082325cca532a4c733c946 |
Hashes for nlzss11-1.5-cp311-cp311-macosx_10_14_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 875819560df0e3d82eb9a7e86df74cda6db887767a7af423df7fc28caa080c96 |
|
MD5 | 0674dc598f47a86d8569f5d187297ec1 |
|
BLAKE2b-256 | d9f9652e9db5536cfc4d35fba444625bff98c7387d710e821d5e1883f22066df |
Hashes for nlzss11-1.5-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76ca27db076ec21e99d1d37ba280de6ecd7c48942d8406562fc7020953a0640d |
|
MD5 | 580a9af3a43d35d08b0a1bc6d76c39bb |
|
BLAKE2b-256 | d9b63eaa2e1232220004c20803ed2e22ea3d0877adcfe75bcaa81421381f28b9 |
Hashes for nlzss11-1.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b4fdf796abc65481afc95e2fffb1701f1343cdc126573cad16b0d79e71c292b9 |
|
MD5 | eebe5e48889c8838d35e3ae882153129 |
|
BLAKE2b-256 | ba5168979a32cfed45965415304733b3651e31ac428c965d7b8a9a42c77e05bd |
Hashes for nlzss11-1.5-cp310-cp310-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e913c745f2e036f985794c85d805a87c525b197ca8fcab7874b16ca5fed3311f |
|
MD5 | e4c15c0aa087da5100941823816761e9 |
|
BLAKE2b-256 | b499143dd745269120a276769f1f3e1498849fe040ea518b0fb13cd49988cf18 |
Hashes for nlzss11-1.5-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fd8b53904eae6e7b4058c4e7e2bf3dee54d7c4490e05f6bdb72c3b4bb9c6b6b6 |
|
MD5 | 1537dfd142db4765225956945669ece9 |
|
BLAKE2b-256 | 92f115e3618e591b1d38c59154c24fd23737c3bc2e9de232699fe8c126be102f |
Hashes for nlzss11-1.5-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bd9f1e5574dffc546f1c237e0957bd4f38db82cdda95638264a3f8587e7b1a18 |
|
MD5 | f8f5d1dc8d943a33fc27a7708bddafde |
|
BLAKE2b-256 | e891bfa0b61a6159f6a31f1c85ccf9177a1ec838e9e02fbe6f94d47a9c147a2c |
Hashes for nlzss11-1.5-cp39-cp39-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdd96bbdce0dfee91942c505cfd91736c471f5302b247af575a2493ea46bf220 |
|
MD5 | 739a26eccedc5668bcf0db837af6673d |
|
BLAKE2b-256 | d56afb8de1a9ab30a8560533953bbf337d9d27ed80cba97efaa873d65088601c |
Hashes for nlzss11-1.5-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | db9ae79ed415fdfc5ec9b406a9d1a81778d70d23a8f94b743c26f757d7bf25d5 |
|
MD5 | 09a3ff388d1752c0716886130f2e4b43 |
|
BLAKE2b-256 | 27d8ab4928d4a7771687ce177c5cbe6db818b75b81c26530f28815053b688dee |
Hashes for nlzss11-1.5-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4592e9863087f1524802e93f0c2440ade31a0425609eb404af691a9f8ebae9a8 |
|
MD5 | bb62027974bd6edf5fdc1069deb883f6 |
|
BLAKE2b-256 | c349e24aae1eb4a230759d4f5877f2a9e66516cf08f37b2df3277811a7fdbfd9 |
Hashes for nlzss11-1.5-cp38-cp38-macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19900b405c2b80428555c924848a8f3a24238245a0ff8dd04cdec287306649d7 |
|
MD5 | 5659d328bc65a8fb0b75d6596cfb6263 |
|
BLAKE2b-256 | 6d240e41e5302c0b15d83687908267f48f13a2d695077964347ca44c1d019f63 |
Hashes for nlzss11-1.5-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab27f0e60e66b0bde5a0365c48a4d329d90162c099874a390391bb6c9ce47c6c |
|
MD5 | cdd0c22ddd2e7119e59bf4cf6cc32a0e |
|
BLAKE2b-256 | 40a52b407868c39d1f1fcea027ea6833a9e44c17633d62a5e047907f518fee05 |
Hashes for nlzss11-1.5-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 086ddeb1b8eaa41f94bec6cf5d6a3c496764afc8bfefcaa976fc1184f1a9e8ab |
|
MD5 | 7c7318885e0200b16a2052112bcea974 |
|
BLAKE2b-256 | 4419f46189524f62ad93cd0676fb71a3c25307e0cd43add399a3ad5de6d55c98 |
Hashes for nlzss11-1.5-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b88b770db40a3ef1145e3ad64ffb5f0351cfb05201d4ee64577d78b2a3709d6f |
|
MD5 | 59a046606dee47be9102f1ff2990066f |
|
BLAKE2b-256 | cb00ba1e204952969fdb692209b72fb648f10a12ee62b4e334983669c2e7b073 |
Hashes for nlzss11-1.5-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 632c61099f128d203500698d286e98a277864c6ed0b50879390af00778323811 |
|
MD5 | 04f22907e47307e1633fb5a6aac92a86 |
|
BLAKE2b-256 | 2757b0202dea8c1e37a4f814ef81946edabe77dbde59c7567a0d2cc938c72292 |