文件集的哈希算法 [英] Hashing algorithm for a file set

查看:120
本文介绍了文件集的哈希算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我需要知道如何为一组文件而不是单个文件创建哈希码.有指针吗?

谢谢,

Jib

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

推荐答案

首先,您必须确定必须使用哪种哈希算法.因为一旦对文件进行哈希处理,然后更改算法将很浪费. .Net框架有很多哈希算法,包括键控和非键控.每个都有不同的目的.例如,MD5擅长处理小文件.但是对于非常大的文件,您可能会发现两个唯一的文件具有相同的哈希值.

这是他们讨论哈希算法选择的链接.这可能有助于您选择算法.然后参考MSDN了解如何实现该算法

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

http://en.wikipedia.org/wiki/Comparison_of_cryptographic_hash_functions [哈希函数:经验比较 [
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.


^ ]可能会为您提供帮助.
this[^] might help you.


这篇关于文件集的哈希算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆