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)) print(hex(num)) #convert back: print(Convertbase.from_b32_to_dec('PPL'))
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
convertbase-0.1.1.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for convertbase-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2969d0392eb9aea56d349909bd31d6286aafce8f6d2d471a25ed5ab477e9cb2 |
|
MD5 | 32d5c309ae6c7e31cff5a5f09d5b47ac |
|
BLAKE2b-256 | d479d52947159246048857a0c67f3c539e5095c3f601e33542684cc6795d6a6e |