tabo / numconv

Python library to convert strings to numbers and numbers to strings. Docs: http://docs.tabo.pe/numconv/tip/

Clone this repository (size: 158.5 KB): HTTPS / SSH
$ hg clone http://code.tabo.pe/numconv

Changed (Δ3 bytes):

raw changeset »

numconv.py (3 lines added, 3 lines removed)

Up to file-list numconv.py:

@@ -124,7 +124,7 @@ class NumConv(object):
124
124
125
125
           Very large number to :data:`~numconv.BASE85`::
126
126
127
               >> NumConv(85).int2str(2693233728041137L)
127
               >> NumConv(85).int2str(2693233728041137)
128
128
               '~123AFz@'
129
129
130
130
        """
@@ -161,7 +161,7 @@ class NumConv(object):
161
161
           Hexadecimal 'DEADBEEF' to integer::
162
162
163
163
              >> NumConv(16).str2int('DEADBEEF')
164
              3735928559L
164
              3735928559
165
165
166
166
           Binary '100101101010100' to integer::
167
167
@@ -176,7 +176,7 @@ class NumConv(object):
176
176
           :data:`~numconv.BASE85` '~123AFz@' to integer::
177
177
178
178
               >> NumConv(85).str2int('~123AFz@')
179
               2693233728041137L
179
               2693233728041137
180
180
181
181
        """
182
182
        radix, alphabet = self.radix, self.alphabet