I have an array of long values in my c# program. Now I need a checksum (the smaller the better) to see if all values are incuded in an other array I want to compare with.
It should be an easy checksum so I can use it with JavaScript/JQuery too. Is there a method/code snippet I can use?
Background:
I have a javascript ajax mvc project that connects periodically (every 10 seconds) to my c# webservice to get a list of long values and sends the last value it has. The long values are consecutive so I will only send the new ones since the last value the client has. But sometimes (1:1000) there is a new long value that is “older” and not consecutive. To avoid that the javascript will not get this value (as it gets only the newest values) I want to add a checksum to see if it has every value. If the checksum is not correct it should fetch the complete list again.
the simplest way: