On Tue, Apr 17, 2007 at 04:34:25PM +1000, Carlo Sogono 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. > > I am a competent C programmer so I can ideally code this in C and use it > as a Python module (haven't tried this yet though..) but prefer to work > on Python only. I'm not an expert Python programmer so I'm gonna need > some help here.
I know this is old thread, but I just found it in my 'aside' inbox. There's a bitvector class here which might help: http://cheeseshop.python.org/pypi/BitVector Also there's a whole library for fiddling with binary called hachoir: http://hachoir.org/ Matt _______________________________________________ coders mailing list coders@slug.org.au http://lists.slug.org.au/listinfo/coders