Skip to main content

Encodes and decodes sequences of integers with known widths, and sequences of symbols equivalent to integers under some mapping.

Project description

Sub_Byte

Encodes and decodes sequences of integers with known widths (and sequences of symbols equivalent to integers under some mapping).

Overview

Sub_byte efficiently stores data, while preserving its structure, without requiring compression or decompression. Simple bit packing, using less than a byte for <=7 bit fiels less, crossing byte boundaries if necessary, utilising a known fixed bit width for each symbol (avoiding continuation bits). The bit width sequence and the total number of symbols, must be associated with the encoded data as meta data. Data validation (e.g. checksums or hashes) must be done by the user, but can be appended to a bit width cycle.

Implementations

Python

Calculate a cache of data in Python.

Javascript

Decode a cache of data in Javascript, even in browser.

Alternatives

A bespoke protocol using custom width integer types

Up to 8 u1s (bits), up to 4 u2s, or up to 2 u3s or u4s per byte. Each developer must create their own implementation and tests. Interoperability between different private implementations is untestable.

Protocol buffers

Encodes max symbol per byte. Variable byte encoding - uses continuation bits.

Zipping (data compression)

  • Exploits statistical distributions (e.g. "E" being more common in English text than "Q") and patterns.
  • Unstructured until the end user unzips the archive.

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

sub_byte-0.0.2.tar.gz (30.0 kB view details)

Uploaded Source

Built Distribution

sub_byte-0.0.2-py3-none-any.whl (5.7 kB view details)

Uploaded Python 3

File details

Details for the file sub_byte-0.0.2.tar.gz.

File metadata

  • Download URL: sub_byte-0.0.2.tar.gz
  • Upload date:
  • Size: 30.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.4

File hashes

Hashes for sub_byte-0.0.2.tar.gz
Algorithm Hash digest
SHA256 9a42f5ea35ac33cd1e46df2c0d9ccf4e779c3c88f42496145b48768d5c794d70
MD5 d055b0ace7c4e9ced3fab7b8eb78bd2c
BLAKE2b-256 504cd5416decedbf6f65d73c11e579d5e151bd318d5fe9b32945b7cd7b2e27bf

See more details on using hashes here.

File details

Details for the file sub_byte-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: sub_byte-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 5.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.4

File hashes

Hashes for sub_byte-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f53e5465adf92f9dc6e1d7ac261aec5c43ceb838581ca8ede3e416d1f92227a3
MD5 80e59bda0fee9185bd8be65688c56415
BLAKE2b-256 124bf82f30e892fb70d681f7df9b34e2de0fa7bbf9c1afe9f0a7c2bfae0e73b2

See more details on using hashes here.

Supported by

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