Skip to main content

Convert between bases, initailly intended for RFC4648 base32

Project description

Universal base converter

Use either with predefined converters:

  • integer to base32(RFC4648)
  • integer to hex
  • base32(RFC4648) to integer

Or use with custom settings:

  • set base
  • set charset

Examples:

if __name__ == "__main__":
    # example:
    num = 15851

    # using instance of converter, using custom settings
    converter = Convertbase()
    converter.set_base(32)
    converter.set_charset('ABCDEFGHIJKLMNOPQRSTUVWXYZ234567')

    print(converter.convert(num))

    # or using static methods:
    print(Convertbase.to_b32(num))

    # hex, compare to built-in
    print(Convertbase.to_hex(num))
    print(hex(num))

    #convert back:
    print(Convertbase.from_b32_to_dec('PPL'))

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

convertbase-0.1.3.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.

convertbase-0.1.3-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file convertbase-0.1.3.tar.gz.

File metadata

  • Download URL: convertbase-0.1.3.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for convertbase-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9ea2a2e9d34c13710ff98907ef84e4fef45c20c3ea95ac47ee1905059269395d
MD5 20cbb714ef461fd31242d80432677643
BLAKE2b-256 eea1f26a2f9db356569506f51c49782a5c89d2b4a60932cb3f75d2be2c81e66a

See more details on using hashes here.

File details

Details for the file convertbase-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: convertbase-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 4.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/51.1.1 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for convertbase-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b165833ad3dfa5fb212fbdb0102656e0bf0bc106f42d244bb98fbf12d71f720c
MD5 5340c70cec8ac9e56727a608113c9515
BLAKE2b-256 7de0bbbd7443a874af641104322ffbbfd028e41bfea2847aca8070a7d65919ca

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