Skip to main content

Package implements base26 encoding/decoding algorithm.

Project description

base26

PyPI

This library provides functions for encoding binary data to printable ASCII characters and decoding such encodings back to binary data. The algorithm is Base26.

Base26 encoding takes binary data (a byte array) and converts it into a stream of letters, drawn from a 26-character pool in capital letters, e.g. byte arrays of 0xA5, 0x05, 0x4B = Base26 encoded value of "TDTTKA".

Decoding is the reverse of encoding, taking a string of capital letters and turning it back into a byte array. The Base26 decoding algorithm may add an extra 0 byte at the end of the returned payload. The algorithm should check for this: typically, if the returned payload size is 129 and if it is equal to 0 remove it.

It's similar to Base64 but with a smaller pool of characters.

Base64 = ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/
Base26 = ABCDEFGHIJKLMNOPQRSTUVWXYZ

Development

Install dependencies

python -m pip install pip-tools
pip-compile --extra dev pyproject.toml
pip-sync

Install base26 package in editable mode

python -m pip install -e .

Run tests

pytest tests

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

base26-1.0.5.tar.gz (3.5 kB view hashes)

Uploaded Source

Built Distribution

base26-1.0.5-py3-none-any.whl (3.8 kB view hashes)

Uploaded Python 3

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