[Python-Dev] Zipfile needs?

Guido van Rossum gvanrossum at gmail.com
Mon Jan 3 08:17:59 CET 2005


> Encryption/decryption support.  Will most likely require a C extension since
> the algorithm relies on ints (or longs, don't remember) wrapping around when
> the value becomes too large.

You may want to do this in C for speed, but C-style int wrapping is
easily done by doing something like "x = x & 0xFFFFFFFFL" at crucial
points in the code (for unsigned 32-bit ints) with an additional "if x
& 0x80000000L: x -= 0x100000000L" to simulate signed 32-bit ints.

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


More information about the Python-Dev mailing list