2
from Crypto import Util
8
return struct.pack('!L',len(t)) + t
10
def getNS(s, count=1):
15
for i in range(count):
16
l = struct.unpack('!L',s[:4])[0]
19
return tuple(ns) + (s,)
22
if number==0: return '\000'*4
24
bn = Util.number.long_to_bytes(number)
27
return struct.pack('>L',len(bn)) + bn
31
get multiple precision integer
33
length=struct.unpack('>L',data[:4])[0]
34
return Util.number.bytes_to_long(data[4:4+length]),data[4+length:]
39
goes through the first list, looking for items in the second, returns the first one