base-96

Tim Roberts timr at probo.com
Sat Aug 2 19:16:02 EDT 2008


Kless <jonas.esp at googlemail.com> wrote:
>
>I think that would be very interesting thay Python would have a module
>for working on base 96 too. [1]

Well, then, write one.

However, I'm not sure I see the point.  Base 64 is convenient because 6
bits becomes 8 bits exactly, so 3 bytes translates exactly to 4 characters.
With base 96, you would end up doing division instead of just shifting and
masking; the conversion isn't as "neat".

>As you can see here [2], the printable ASCII characters are 94
>(decimal code range of 33-126). So only left to add another 2
>characters more; the space (code 32), and one not-printable char
>(which doesn't create any problem) by last.

This leaves some tricky issues.  How will you denote the end of a base 96
sequence?  If every printable character can be part of the ciphertext, what
can you use as an end marker or a padding character?
-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the Python-list mailing list