diff --git a/__init__.py b/__init__.py index 93dce7b..155b55a 100755 --- a/__init__.py +++ b/__init__.py @@ -110,7 +110,7 @@ def assert_in(a, *b): ## -## Binary stuff +## Binary and other base conversions ## class BitVector: @@ -206,6 +206,12 @@ def unhex(s): return [ord(i) for i in s.replace(' ', '').decode('hex')] +def pp(value, bits=16): + if type(value) == type(''): + value, _ = unpack('