title: How many bytes of checksum for byte array length 1000
body: <p>I am implementing a reliable data transfer protocol. The maximum packet length is 1000 bytes. How many bytes do I need to store the checksum for the maximum packet size? I tried using one byte to store the checksum, but but the receiver is unable to obtain the same checksum as the stored one.</p>
  
  <pre><code>Checksum checksum = new CRC32();
  checksum.update(out_data, 0, out_data.length-1);
  
  Long checksumValue = checksum.getValue();
  out_data[out_data.length-1] =  checksumValue.byteValue();
  </code></pre>
  
  <p>Here's my code for checksum implementation. I used the last slot of the byte array for the checksum. Note that this is not a case of corrupted packet as the simulation of the unreliable network that I'm running can be made to be reliable.</p>