def PackLongList(longs):
 packed = struct.pack(('<' + ('q' * len(longs))), *longs)
 if ((len(packed) > (8 * 15)) or (longs[0] == 18446744073709551615L)):
  return ('\xff\xff\xff\xff\xff\xff\xff\xff' + zlib.compress(packed))
 else:
  return packed

def PackLongList ( longs ) : packed = struct . pack ( ( '<' + ( 'q' * len ( longs ) ) ) , * longs ) if ( ( len ( packed ) > ( 8 * 15 ) ) or ( longs [ 0 ] == 18446744073709551615 L ) ) : return ( '\xff\xff\xff\xff\xff\xff\xff\xff' + zlib . compress ( packed ) ) else : return packed
pack a list of longs to a compact string .