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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file base26-1.0.5.tar.gz.

File metadata

  • Download URL: base26-1.0.5.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for base26-1.0.5.tar.gz
Algorithm Hash digest
SHA256 83faadf536793af04980600c7cdab9423e0c3d9112321d372ccd8a916c4c17b0
MD5 d0d470425d0cdb401a6905ced2d49946
BLAKE2b-256 45223ab8b7de2db454f78f1f5c3004a35d8eb9e4272cc65065a962355b3e88c6

See more details on using hashes here.

File details

Details for the file base26-1.0.5-py3-none-any.whl.

File metadata

  • Download URL: base26-1.0.5-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.15

File hashes

Hashes for base26-1.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9e9ff917cd5ea95358054ed7dafc3d57b2053c88e6d3684ddd796046a0f4a42b
MD5 f5687fcc5b9438f040bd0c0c78849e54
BLAKE2b-256 ad87745f61841a6b6bf7deace4f49b3269a5dde535b75cf6ec1aeeca0c4b91d6

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