Need "sum" compatible checksum16 in Python

Fredrik Lundh fredrik at pythonware.com
Sat May 12 08:44:50 EDT 2001


Alex Martelli wrote:

> I'm not sure if ord() returns -128 to 127, or 0 to 255,
> whence the &0xFF.

misplaced your interpreter today? ;-)

ord(char) returns the code points in the range 0..255
for 8-bit strings (0..65535 for unicode strings).

Cheers /F





More information about the Python-list mailing list