[Python-Dev] Base-96 (original) (raw)

Guido van Rossum guido at python.org
Sat Aug 2 03:56:05 CEST 2008


This sounds more like something to bring up in python-ideas at python.org. Also, rather than being vague about the motivation ("would be very interesting", you ought to think of a realistic use case. For example, are there existing encodings of binary data using base-96? I'm not aware of any.

On Fri, Aug 1, 2008 at 4:06 PM, 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]

It could be converted to base 96 the digests from hashlib module, and random bytes used on crypto (to create the salt, the IV, or a key). 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.

[1] http://svn.python.org/view/python/trunk/Modules/binascii.c [2] http://en.wikipedia.org/wiki/ISO/IEC8859-1

-- --Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-Dev mailing list