[Python-Dev] Base-96

2008-08-01 Thread Kless
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/IEC_8859-1
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Base-96

2008-08-02 Thread Kless
It's true, I didn't pay attention to that.

So the next encoding possible would of base-128 (7-bits encoding),
althought I don't know if were possible since that there would than
use non-printable characters and could change the text (by use of
chars. as Backspace or Delete).

On 2 ago, 03:21, Steve Holden <[EMAIL PROTECTED]> wrote:
> 96 is approximately 2^6.585
>
> For some reason, integral powers of two seem so much more, well,
> POWERFUL, if you know what I mean. Frankly I think you are being either
> optimistic or charitable in suggesting that such a use case might exist.
>
> There's a reason that DEC called their equivalent of base64 "6-bit
> encoding".
>
> But then I wanted to keep integer division as it was, so I am clearly a
> techno-luddite. If the world wants fractional bits I'm sure it's only a
> matter of time before some genius decides to design a 67.9-bit computer.
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com