Click here to Skip to main content
15,888,351 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I need to know how I can create a hash code for a set of files, rather than individual files. Any pointers?

Thanks,

Jib
Posted

First you have to decide which hash algorithm has to use. Because once you hashed the files then changing the algorithm will be a waste. There are lot of hash algorithms with .Net framework, Keyed and Non-Keyed. Each has different purpose. For example MD5 is good at small files. But for very large files you may find two unique files has same hash.

here is a link where they discuss about hash algorithm choices. Which may helpful for you to choose the algorithm. Then refere MSDN for how to implement that algorithm

http://stackoverflow.com/questions/800685/which-hash-function-should-i-choose[^]

http://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions[^]

Hash Functions: An Empirical Comparison[^]

The largest hash key is produced by the MACTripleDES (uses a key length of 24 bytes and produce a hash of 8 bytes) in .net framework. But you need to decide such long key is required for your case or not.
 
Share this answer
 
Comments
Sergey Alexandrovich Kryukov 11-Mar-11 13:00pm    
Very good, my 5.
--SA
Albin Abel 11-Mar-11 13:38pm    
Thanks SAKryukov
this[^] might help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900