title: Create checksum for fields of a record
body: <p>I have a database with several fields of various types (basically String, Integer and Decimal). I'd like to create a control field to store something like a checksum in order to detect simple value changes from any among those fields.</p>
  
  <p>I first thought of collecting <code>.GetHashCode</code> from each field value just before calling <em>INSERT INTO</em> against the database, and performing some arithmetical operation complex enough to be difficult form someone to manually replicate, and putting this result as value for the control field:</p>
  
  <pre><code>Function ControlFieldValue(ParamArray values() As IEnumerable(Of Object)) As Long
      Dim retval As Long
      For Each v In values
          If retval = 0 Then
              retval = v.GetHashCode
          Else
              retval = retval Mod v.GetHashCode
          End If
      Next
      Return retval
  End Function
  </code></pre>
  
  <p>But I don't know how effective this would be. Is there some simple implementation  in VB.NET for such purpose? Thank you very much.</p>