Iterative / Additive MD5

Posted by Andrew Robinson on Stack Overflow See other posts from Stack Overflow or by Andrew Robinson
Published on 2010-04-28T23:04:15Z Indexed on 2010/04/28 23:07 UTC
Read the original article Hit count: 292

Filed under:
|

I need to generate a checksum over a dictionary. Keys and Values.

Is there any simple way to accomplish this in an iterative way.

foreach(var item in dic.Keys) checksum += checksum(dic[item]) + checksum(item);

In this case, keys and values could be converted to strings, concatinated and then a single checksum applied over these but is there a better way?

Ideally MD5 but other options could work. Using this to validate data that is passed over a couple of storage methods. The checksum is then encrypted along with some other information (using AES) so I am not horribly worried about an ideal, unbreakable checksum.

© Stack Overflow or respective owner

Related posts about c#

Related posts about encryption