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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bihexdomedi-0.0.21.tar.gz
(1.3 kB
view hashes)
Built Distribution
Close
Hashes for bihexdomedi-0.0.21-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1593fe88096c58ab80de2352c05077c11894877092d790312f9d4e13ceaf4625 |
|
MD5 | 1ba49dd347d28d230d3c5b53c5662a35 |
|
BLAKE2b-256 | 71f5bfd0c4b2065de1578f68f5f693278a2994c5bb84300f8b89c4d7e9bc6959 |