Comments on base52 encoder/decoder ?

Bengt Richter bokr at
Tue Jan 7 14:38:40 CET 2003

On Mon, 06 Jan 2003 20:21:34 -0800, Erik Max Francis <max at> wrote:

>Bengt Richter wrote:
>> What it boils down to is that there are enough codes for two sets
>> of encodings plus 9023 special codes. You can think of it as a single
>> bit attribute for arbitrary subsequences of binary bytes with no extra
>> encoding characters vs doing them separately as before, and 9023
>> integer
>> codes can be inserted also at a cost of 3 code characters apiece. You
>> can think of them as available escape codes.
>My initial, gut reaction to this is that you're getting too fancy for
>your own good.
Was it the extras, or just putting too much on the plate at once? ;-)

What if I had just started with the default encoding/decoding
and showed one useful example?

E.g., it makes a nice safe all-alpha hash string from md5
(that is also 25% shorter than hex):

 >>> import base52x
 >>> b2a = base52x.b2a_base52
 >>> a2b = base52x.a2b_base52
 >>> import md5

 >>>"Nobody inspects the spammish repetition").digest()

 >>>"Nobody inspects the spammish repetition").hexdigest()

 >>> b2a("Nobody inspects the spammish repetition").digest())

Verifying that the info is all there (for this case ;-):

 >>> a2b('RmcOqbUwePkJUgeTEhNWoYLt')

Bengt Richter

More information about the Python-list mailing list