Skip to main content

A Python utility for encoding/decoding arbitrary-base numbers.

Project description

basewhat

A Python utility for encoding/decoding arbitrary-base numbers.

Project home page: https://gitlab.com/paul_bissex/basewhat

Author: Paul Bissex paul@bissex.net

License: MIT

Usage

>>> b16 = BaseWhat(base=16)
>>> b16.from_int(65535)
'FFFF'
>>> b16.to_int('DECAFBAD')
3737844653
>>> b32 = BaseWhat(digits="23456789ABCDEFGHJKLMNPQRSTUVWXYZ")
>>> b32.from_int(32767)
'ZZZ'
>>> b32.from_int(9223372036854775808)
'A222222222222'
>>> b32.to_int('1900MIXALOT')
Traceback (most recent call last):
...
ValueError: Not a valid base 32 number

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

basewhat-1.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

basewhat-1.1.1-py3-none-any.whl (3.2 kB view details)

Uploaded Python 3

File details

Details for the file basewhat-1.1.1.tar.gz.

File metadata

  • Download URL: basewhat-1.1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for basewhat-1.1.1.tar.gz
Algorithm Hash digest
SHA256 42523370d177b7e269cfa7bf63274528d72339e0927c477039afb304b3b94385
MD5 dfdbd323384ea0a38f05f7d9e9e46473
BLAKE2b-256 cbc4d86a2e094bac4822a6ce8a71c577afef210a8e16875166b15badf5ddfcad

See more details on using hashes here.

File details

Details for the file basewhat-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: basewhat-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.13.3 Darwin/24.4.0

File hashes

Hashes for basewhat-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0536b1701900cdd87f362c41fdbb4f469192f2a225014109269bff37a4939d5e
MD5 f381372fb535651f8bacb7a55e5fb1ec
BLAKE2b-256 7a301fce8ae71dc1fec02043ef3a98793828fafea6446ff4aeedf5ab7e8c67d1

See more details on using hashes here.

Supported by

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