convert bytestring to int (helper func for getting messages from peers)