A simple Python library for decoding bytes
Project description
Byte Codec
A simple Python Library for encoding and decoding various data types to and from bytes.
Installation
pip install byte-codec
Usage
from byte_codec import ByteCodec
codec = ByteCodec()
# Encoding
int_bytes = codec.encode_from_int(12345)
string_bytes = codec.encode_from_string("Hello, World!")
float_bytes = codec.encode_from_float(3.14159)
list_bytes = codec.encode_from_list([b'\x01\x02', b'\x03\x04'])
# Decoding
int_value = codec.decode_to_int(int_bytes)
string_value = codec.decode_to_string(string_bytes)
float_value = codec.decode_to_float(float_bytes)
list_value = codec.decode_to_list(list_bytes, 2)
# Generic encoding
any_bytes = codec.encode_from_any(12345) # Works with int, str, float, list, or bytes
License
This Project is licensed under the MIT License - see the LICENSE file for details.
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
byte_codec-0.1.3.tar.gz
(3.8 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file byte_codec-0.1.3.tar.gz.
File metadata
- Download URL: byte_codec-0.1.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b2e7582e2e994c8579628e26e5343cdf93384b02d260a44ef60e2ece11cf130
|
|
| MD5 |
005668191bab868709bef162b9acab29
|
|
| BLAKE2b-256 |
441216b1bd90634d95828d48c5cd6e842c829b8c55115a482bd3bf9f38d27616
|
File details
Details for the file byte_codec-0.1.3-py3-none-any.whl.
File metadata
- Download URL: byte_codec-0.1.3-py3-none-any.whl
- Upload date:
- Size: 3.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6afb932b351816fc768881ae9f0475274fdc389cdc1eba0757e0b19d61046b2b
|
|
| MD5 |
13988cac390cfd355bbbcafa4e0138b6
|
|
| BLAKE2b-256 |
a985ffdb5d8375ea91e928a1f4da70e0c04fa8504423aef16bf8fc2117ab6f62
|