python-weirdbase - Convert weird and arbitrary number bases to and from integers
Want to convert an integer to a string representation of weird number base like base36? We have you covered.
>>> import weirdbase
>>> weirdbase.int2base(12345, base=36)
'9IX'
>>> weirdbase.base2int('9IX', 36)
12345
By default, it's case-sensitive, so you can also do:
>>> weirdbase.base2int('helloThere', 62)
590996557455853334
>>> weirdbase.int2base(590996557455853334, 62)
'helloThere'
And you can convert from one weird base to another; say from base 62 to hex:
>>> weirdbase.base2base('helloThere', 62, 16)
'833A43CDEA28716'
And you can even make up your own set of digits to get weirder:
>>> weirdbase.int2base(420, base=10, chars=')!@#$%^&*(')
'$@)'
>>> weirdbase.base2int('$@)', base=10, chars=')!@#$%^&*(')
420
Installing
pip install git+https://github.com/darrenpmeyer/python-weirdbase.git
Release files for weirdbase 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| weirdbase-0.1.1.tar.gz | 5.9 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| weirdbase-0.1.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 9.4 kB
Release files / weirdbase-0.1.1.tar.gz
| Download URL | weirdbase-0.1.1.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
07aa4a8adc1613f6cf0363ad3c9c7729da0d43bb7fd989af91e8c84e1188a189
|
|
BLAKE2b-256 checksum How to use checksums |
49195390ea6b1c87f9af67fda321a89c25fe21333d216bdf5d56586691471d82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.22.0
|
Release files / weirdbase-0.1.1-py2.py3-none-any.whl
| Download URL | weirdbase-0.1.1-py2.py3-none-any.whl |
|---|---|
| Size | 3.6 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
ab4c4faa1dc20625d088ecb27ad82470372410f39965cf960ff7f8e6f90de3fc
|
|
BLAKE2b-256 checksum How to use checksums |
b98a516b0cfbf52a6d82f86cc4403e7e6238ba172f1bb72164f7969704bd17f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
python-requests/2.22.0
|