def bytes_to_num(bval):
 num = 0
 num += ord((bval[0] << 24))
 num += ord((bval[1] << 16))
 num += ord((bval[2] << 8))
 num += ord(bval[3])
 return num

def bytes_to_num ( bval ) : num = 0 num += ord ( ( bval [ 0 ] << 24 ) ) num += ord ( ( bval [ 1 ] << 16 ) ) num += ord ( ( bval [ 2 ] << 8 ) ) num += ord ( bval [ 3 ] ) return num
convert a four byte sequence to an integer .