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://helixteamhub.cloud/paulbissex/projects/basewhat/

Author: Paul Bissex paul@bissex.net

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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: basewhat-1.1.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.4.0

File hashes

Hashes for basewhat-1.1.tar.gz
Algorithm Hash digest
SHA256 34a0c8d64f29b15cd5fa3df87e858f5671ffe77ff8b7de3830fc000e94fb3d6e
MD5 23a32ab90592b3bde002d95aacdad2bb
BLAKE2b-256 8aafcab831962761c4275910723eb84fe865e20be55559a6fdb02bdac8c0a492

See more details on using hashes here.

File details

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

File metadata

  • Download URL: basewhat-1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.12.3 Darwin/23.4.0

File hashes

Hashes for basewhat-1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 213547a1f5e6870d0cc1731f921dd1fb3be853e76c58afd5351d91a09bc8c30d
MD5 1498d5a680abe7d0a5159f080cd4c81d
BLAKE2b-256 59bf51d8b1fed16a246d0dce7bbb3b97fe176c8de889a8c2e42cd8335f50de97

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