A convenient wrapper around the `struct` python module. It contains convenient reader and writer classes that can be used to write primitive data types in a specific byte order.
Project description
BINIO - is a wrapper around the struct
python module. It contains
convenient reader and writer classes that can be used to write primitive data
types in a specific byte order.
In addition it supports:
- LEB128 for encoding unsigned variable length integers.
- Zigzag for encoding signed variable length integers.
Usage
import binio
value = 255
writer = binio.BinaryWriter(binio.ByteOrder.LITTLE)
writer.write_uint8(value)
reader = binio.BinaryReader(writer.bytes, binio.ByteOrder.LITTLE)
assert value == reader.read_uint8()
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 Distribution
pybinio-0.1.0-py3-none-any.whl
(18.1 kB
view hashes)
Close
Hashes for pybinio-0.1.0.linux-x86_64.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9847bf98454b4c0709d56406e72fbdb10b020b5c518852d4dfcd0ed2b3f0d8a |
|
MD5 | 499872ff9078b88c42afd8bffc24cf14 |
|
BLAKE2b-256 | a903997a3fb7f3f71f5a94233525a8e2f7e618a1757613e9fc4b17890978d4ed |