def decode_long(data):
 nbytes = len(data)
 if (nbytes == 0):
  return 0L
 ashex = _binascii.hexlify(data[::(-1)])
 n = long(ashex, 16)
 if (data[(-1)] >= '\x80'):
  n -= (1L << (nbytes * 8))
 return n

def decode_long ( data ) : nbytes = len ( data ) if ( nbytes == 0 ) : return 0 L ashex = _binascii . hexlify ( data [ : : ( - 1 ) ] ) n = long ( ashex , 16 ) if ( data [ ( - 1 ) ] >= '\x80' ) : n -= ( 1 L << ( nbytes * 8 ) ) return n
decode a long from a twos complement little-endian binary string .