文件集的哈希算法

编程入门 行业动态 更新时间:2024-10-21 17:31:49
本文介绍了文件集的哈希算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

大家好, 我需要知道如何为一组文件而不是单个文件创建哈希码.有指针吗? 谢谢, 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了解如何实现该算法 stackoverflow/questions/800685/which-hash-function-should- i-choose [ ^ ] en.wikipedia/wiki/Comparison_of_cryptographic_hash_functions [ ^ ] 哈希函数:经验比较 [ ^ ] 框架中的最大哈希密钥由MACTripleDES生成(使用24位字节的密钥长度,并生成8个字节的哈希).但是您需要确定是否需要这种长键. 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 stackoverflow/questions/800685/which-hash-function-should-i-choose[^] en.wikipedia/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 framework. But you need to decide such long key is required for your case or not.

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

更多推荐

文件集的哈希算法

本文发布于:2023-11-29 21:48:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1647716.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:算法   文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!