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 crams as many symbols into each byte as possible using simple bit packing, crossing byte boundaries if necessary, utilising a known fixed bit width for each symbol. These bit widths and the total number of symbols, must be associated with the encoded data as meta data.

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.1.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

sub_byte-0.0.1-py3-none-any.whl (7.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: sub_byte-0.0.1.tar.gz
  • Upload date:
  • Size: 29.7 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.1.tar.gz
Algorithm Hash digest
SHA256 6e33e218a91535f57d617aab783469d0890897d26c0e542b64c653b489d7ee25
MD5 67a9a399db8c11a61c9efb8d64472908
BLAKE2b-256 2a94a586f35669483047fdf3a840a7eef2c1dd2b5fc1fbed7d822c7a0904acdc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: sub_byte-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 7.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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b5ebd97b9f9460faaebe6a08bff643ad70a3b0ebae781ed53159d5c7d449a2e4
MD5 3fce74ebef7d0c004a2694374e288c84
BLAKE2b-256 db317c5423cfaa386daec2cb38ee59e290b5f9481e3d6f83349f9aed836f14ac

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