On Wed, 05 Sep 2001, Benjamin Bruheim phed@twistedmatrix.com wrote:
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?
Moshe Zadka wrote:
Was there a good reason you reimplemented the struct module in Python?
Yes, struct can't deal with arbitarily long integers:
struct.pack("L", 299999999999999999999999999999999999999999l)
Traceback (most recent call last): File "<console>", line 1, in ? OverflowError: long int too long to convert