Convert to and from multiple bases
Project description
BiHex
Simple base convert
How to install
pip install bihex-domedi
How to use
from BiHex import *
To create an instance, use:
foo = Bihex("b10110100")
, where the letter behind the number is the base (2 = b, 8 = o, 10 = d, 16 = x)
To display the number in:
- decimal:
foo.returnnum("d")
, gives"180"
- binary:
foo.returnnum("b")
, gives"0b10110100"
- hexadecimal:
foo.returnnum("x")
, gives"0xB4"
- octal:
foo.returnnum("o")
. gives"0o264"
To display the number's original base, use foo.returnbase()
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
bihex-domedi-0.0.6.tar.gz
(1.6 kB
view details)
Built Distribution
File details
Details for the file bihex-domedi-0.0.6.tar.gz
.
File metadata
- Download URL: bihex-domedi-0.0.6.tar.gz
- Upload date:
- Size: 1.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64e4f2ea2cb465e115f038ac64dce4fc95bf13912143fefe84d9afe54c76df91 |
|
MD5 | cb4619756b02cef03f90ef987a2f969c |
|
BLAKE2b-256 | 722fb08529c10546875f7cce6e01fcd154355d17b508a0a7957311b165a9fe58 |
File details
Details for the file bihex_domedi-0.0.6-py3-none-any.whl
.
File metadata
- Download URL: bihex_domedi-0.0.6-py3-none-any.whl
- Upload date:
- Size: 2.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.7.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5bbe6b2940b2fc9bb554ac13cdab6e65a3e631e8ad7bcf601ed36fea7081f80d |
|
MD5 | 9aa659e4c95a2a2c6bd729b5f9d4ab1a |
|
BLAKE2b-256 | cbd2654a25d6544030adfafa8f5caedd8d567cd959a88ca8d151992fc4e3fbf8 |