[Twisted-Python] Re: +AFs-Twisted-Python+AF0- Re: +AFs-Twisted-commits+AF0- CVS: Twisted/twisted/python otp.py,NONE,1.1

Benjamin Bruheim grolgh at online.no
Wed Sep 5 19:09:35 MDT 2001


> > def stringToLong(s):
> >     """ Convert bytes to long integer """
> ...
> > def stringToDWords(s):
> >     """ Convert bytes to a list of four 32-bits words """
> ...
> > def longToString(l):
> >     """ Convert long to digest """
> ...
> 
> Was there a good reason you reimplemented the struct module in Python?

Well, struct seems almost like an overkill, but could probably replace most usage of these routines. If I should need a good reason for keeping them, it would be my uncertainity of its (structs) endianism/portability since the codes need to be. It just looks like a module only used in interfacing. 

This is an only excuse since I didn't know of struct. :) Thanks for the tip

// phed







More information about the Twisted-Python mailing list