Powerful little-endian base-128 encoding/decoding library for Python 3.
Project description
pyleb128
Powerful little-endian base-128 encoding/decoding library for Python 3.
Supports the following types:
- Unsigned LEB128
- Signed LEB128
- Unsigned LEB128 +1 (ULEB128P1)
Example Usage
from pyleb128 import uleb128, sleb128
# unsigned
print(uleb128.decode(b'\xff\xff\x03')) # 65535
print(uleb128.decode(b'\xff\xff\x03').encoded) # b'\xff\xff\x03'
print(uleb128.decode(b'\xff\xff\x03', p1 = True)) # decode with as ULEB128P1
# signed
print(sleb128.decode(b'\xf3\xff\xff\xff\x0f')) # -13
print(uleb128.decode(b'\xf3\xff\xff\xff\x0f').encoded) # b'\xf3\xff\xff\xff\x0f'
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyleb128-0.1.2.tar.gz
(14.9 kB
view details)
Built Distribution
pyleb128-0.1.2-py3-none-any.whl
(15.5 kB
view details)
File details
Details for the file pyleb128-0.1.2.tar.gz
.
File metadata
- Download URL: pyleb128-0.1.2.tar.gz
- Upload date:
- Size: 14.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d1c26dea34fe048c28bb3498304402a1967484d1414b74486f11c56e24d977c0 |
|
MD5 | 014cf87e6b9dd08133c7e5f28a6e6fab |
|
BLAKE2b-256 | f43c780059ee6ff4cd5af82898c5661ef692c691c46c5b26f8a13d58a9401fcf |
File details
Details for the file pyleb128-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: pyleb128-0.1.2-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.4 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5195638d5daa34be70224dccc98384153b5eb94510a390619d62a4f5c4ccccaf |
|
MD5 | 8d96b95239fbee5310e3d68b4de427c0 |
|
BLAKE2b-256 | d1304364c592c71abca4c457c8798e50eb5cf762bbb6c469dbec3379560d7f49 |