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 .
.
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.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 611b59798abaf8327a16742eab16f5163e9c589186d1bffdf0f4f5cfe936b16a |
|
MD5 | 7c529a245944354e12d53f27517b611f |
|
BLAKE2b-256 | 96c2adc60cc4120f2206155e8434d56bd007f31e04e38fdfa74cb48b3de47076 |
Hashes for nlzss11-1.1-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bee555bf983dae7ce3b3e5a50ec0648b2b4a64cd803618966123e360f454ec3 |
|
MD5 | 3074cf3a0e9675d964a3da683a679146 |
|
BLAKE2b-256 | aada95ab091c3dfefefac818bc384bbb771abfbd779884007eeea4fd48a3165b |
Hashes for nlzss11-1.1-cp38-cp38-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60fc6d1c228bb989c56287e9e2ccd3327dd01527838dcb579f66c1a60b59586c |
|
MD5 | 7443d977bb4fc2d4c070b0947e94a827 |
|
BLAKE2b-256 | 64006a3130e8f31be01c0eaec2f821df8066e1f7b82c2e7b42bff7bb8cfb83dc |
Hashes for nlzss11-1.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c416dc205613f214d418ffbdf7eb7a331e62a86e0bdb70d64f394db18d87170e |
|
MD5 | 95df091706712621efbabf46ed836930 |
|
BLAKE2b-256 | 79af247dfb8e870c44d0133381f64739ac4d37da26d76004887c97884e8047e4 |
Hashes for nlzss11-1.1-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4705efbb92c5a73275d194d3cc316b5d89322c62e9e7b6f5637fb88b72508fdc |
|
MD5 | 0f307a8af9fe1814eef47fba8c8423f8 |
|
BLAKE2b-256 | f75a7a9893786420fd7899aef1d2ee193a47bd73a2465b06f2d005c6ee7d2dda |
Hashes for nlzss11-1.1-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 935f548bfe3b824f688b07adcaadd02ee32c157bb88c7129b65524cf84c04b1f |
|
MD5 | 40ef997f41261b943a4aff490a09ecf5 |
|
BLAKE2b-256 | 1e7b6aa30c05180e597cc62779c545b40bc34ad4dc25bce34c87bf64477cc2a4 |
Hashes for nlzss11-1.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c732cb8950e85dd93d80412b24f3f1f41788b098c14eefd03e278813bd16094 |
|
MD5 | d26f69e864fc56de51c306216fabaab4 |
|
BLAKE2b-256 | 80a3d176e987cf9e72557e3c5ae7d3154f9edc17782c58601d8d81250b9f6271 |
Hashes for nlzss11-1.1-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c1b95d4503d74e0aff1aeea58205388e3930aabfbc6192370003557edc7c2ac7 |
|
MD5 | 173a1abceb9bf33db03de92012aa6f40 |
|
BLAKE2b-256 | 7b5746f34595d623436557e2e8e640084725c4675363e6318366e06802aece7d |
Hashes for nlzss11-1.1-cp36-cp36m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce10793fb1f6624f64ee5723f15f6befd8f0cd6c35858482ee73087f367a7d87 |
|
MD5 | 948b03569992452ecc764af4c1836348 |
|
BLAKE2b-256 | 073bea6931934f52e6734f7ed3f406adf1d6a92215fa972df576186f51499458 |
Hashes for nlzss11-1.1-cp35-cp35m-manylinux2010_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5340c7e67c390d49583926a3eb9ba1269d4e06ba28ad854b6ff5273722e7ea82 |
|
MD5 | 385711e2340c44c55281189b8906f8bb |
|
BLAKE2b-256 | 6910739a9db109d574a1bee54be2433e0cd251a147a5ea7a88c72d03f9a4423d |