什么是最快的哈希算法来检查两个文件是否相等? [英] What is the fastest hash algorithm to check if two files are equal?

查看:181
本文介绍了什么是最快的哈希算法来检查两个文件是否相等?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



安全性不是很重要。

编辑:我通过网络连接发送文件,并确保文件两边相同。

解决方案

一种方法可能是使用简单的CRC-32算法,并且只有CRC值比较相等时,才会使用SHA1或更强健的重新运行散列。一个快速的CRC-32将在任何一天超过加密安全散列。

What is the fastest way to create a hash function which will be used to check if two files are equal?

Security is not very important.

Edit: I am sending a file over a network connection, and will be sure that the file on both sides are equal

解决方案

One approach might be to use a simple CRC-32 algorithm, and only if the CRC values compare equal, rerun the hash with a SHA1 or something more robust. A fast CRC-32 will outperform a cryptographically secure hash any day.

这篇关于什么是最快的哈希算法来检查两个文件是否相等?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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