[Python-Dev] Base-95 (Re: Base-96)

Greg Ewing greg.ewing at canterbury.ac.nz
Sun Aug 3 03:35:36 CEST 2008


Kless wrote:

> So the next encoding possible would of base-128 (7-bits encoding)

A while ago I wanted to pack as much information as
possible into a string of printable characters, and
I came up with a base-95 encoding that packs 9 bytes
into 11 characters.

The application involved representing data using
Python string literals, so it was important that only
printable characters were used. I settled on the
9/11 combination as a reasonable compromise between
packing efficiency and not having the block size
too long.

If anyone's interested, I could dig out the
encoding and decoding routines I wrote.

-- 
Greg


More information about the Python-Dev mailing list