Skip to main content

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


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

byte_codec-0.1.3-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

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

Hashes for byte_codec-0.1.3.tar.gz
Algorithm Hash digest
SHA256 6b2e7582e2e994c8579628e26e5343cdf93384b02d260a44ef60e2ece11cf130
MD5 005668191bab868709bef162b9acab29
BLAKE2b-256 441216b1bd90634d95828d48c5cd6e842c829b8c55115a482bd3bf9f38d27616

See more details on using hashes here.

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

Hashes for byte_codec-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 6afb932b351816fc768881ae9f0475274fdc389cdc1eba0757e0b19d61046b2b
MD5 13988cac390cfd355bbbcafa4e0138b6
BLAKE2b-256 a985ffdb5d8375ea91e928a1f4da70e0c04fa8504423aef16bf8fc2117ab6f62

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page