Convert numbers between arbitrary bases.
Python
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
README.md
__init__.py

README.md

Python base module

Information

The base.rebase function provided by this package can be used to convert numbers between arbitrary bases.

Examples

>>> import base
>>> base.rebase('80', base.HEX, base.DECIMAL)
'128'
>>> base.rebase(-255, base.DECIMAL, base.HEX)
'-FF'
>>> base.rebase('1111', base.BINARY, base.DECIMAL)
'15'

MIT license

This project is licensed under an MIT license.

Copyright © 2011 Andreas Blixt (andreas@blixt.org)