On 4/17/07, Carlo Sogono <[EMAIL PROTECTED]> wrote:
I know that many people would tell me that one of the reasons for using
Python is to eliminate the need to do low level operations, but in my
case it's unavoidable. I am working on some cryptographic algorithms
that needs to work with bits. The Python Cryptography Toolkit can't help
me here so I would like to code this on my own.
Specifically I would like to manipulate, add and remove raw bits from a
pickle stream. The type() function returns pickle objects as str types
so I'm a bit unsure how to proceed.
You can either look at the bytes directly:
output = [chr(ord(a) & 0x7f) for a in input]
or look at the struct module for some helpers.
--
Martin
_______________________________________________
coders mailing list
coders@slug.org.au
http://lists.slug.org.au/listinfo/coders