title: Fast and robust checksum algo for a small data file (~10KB)
body: <p>I have a data file that needs to be pushed to an embedded device. The typical size for the file ranges from a few bytes to about 10K max. My intention is to detect tampering with the contents of this file(chksum to be last element in the data file). The data range is a mix of strings, signed and unsigned integers. I am looking for a robust algo to avoid a lot of collisions as well something that does not use a lot of cycles to compute. I am considering <code>Fletcher16()</code>, <code>CRC-32</code> and the solution <a href="https://stackoverflow.com/questions/45633170/is-fletchers16-checksum-suitable-for-small-data">discussed in this post</a></p>
  
  <p>Any suggestions for a simple algo for my kind of data size/contents?</p>
  
  <p>Thanks in advance!</p>
  
  <p><strong>EDIT:-</strong>
  Thanks everyone for the insightful answers and suggestions. </p>
  
  <p>Some background: This is not a hyper secure data file. I just want to be able to detect whether someone wrote it by mistake. The file gets generated by a module and should be just <code>read only</code> by the SW. Recently there has been a few instances where folks have pulled it from the target file system, edited and pushed back to the target hoping that would fix their problems. (Which btw it would if edited carefully). But this defeats the very purpose of auto generatating this file and the existence of this module. I would like to detect and such playful "<em>hacks</em>" and <em>abort gracefully</em>.</p>