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
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
Built Distribution
File details
Details for the file sub_byte-0.0.0.tar.gz
.
File metadata
- Download URL: sub_byte-0.0.0.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 06d4d20070910f8f256c364877d57daa644dc2095f3577c6cf77646e63e73312 |
|
MD5 | 27880e3b28769616aeb9f3451511b474 |
|
BLAKE2b-256 | 2cefb3b395f44010d0997bb2a3a7c41addefa128dcede789eae734937c3f65cd |
File details
Details for the file sub_byte-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: sub_byte-0.0.0-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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 86d1dcd456bbf0c2765238291d0859a2f37efb97fe247f561c4a4ba5c3ea7bb6 |
|
MD5 | 016a9414d31d11105e2c63586a136bea |
|
BLAKE2b-256 | 30efe6ccc1e787ca08d3804d5f575020e2e2de19a13f513f5fea71d2ce6cdba1 |