def intFromBytes(data, byteorder, signed=False):
 assert (byteorder == 'big')
 assert (not signed)
 if ((len(data) % 4) != 0):
  data = (('\x00' * (4 - (len(data) % 4))) + data)
 result = 0
 while (len(data) > 0):
  (digit,) = struct.unpack('>I', data[:4])
  result = ((result << 32) + digit)
  data = data[4:]
 return result

def intFromBytes ( data , byteorder , signed = False ) : assert ( byteorder == 'big' ) assert ( not signed ) if ( ( len ( data ) % 4 ) != 0 ) : data = ( ( '\x00' * ( 4 - ( len ( data ) % 4 ) ) ) + data ) result = 0 while ( len ( data ) > 0 ) : ( digit , ) = struct . unpack ( '>I' , data [ : 4 ] ) result = ( ( result << 32 ) + digit ) data = data [ 4 : ] return result
convert an integer in packed form to a python l{int} .