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

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

问题描述

创建用于检查两个文件是否相等的哈希函数的最快方法是什么?

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

安全性不是很重要.

我正在通过网络连接发送一个文件,并确保双方的文件相同

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

推荐答案

一种方法可能是使用简单的 CRC-32 算法,并且仅当 CRC 值比较相等时,才使用 SHA1 或更稳健的方法重新运行散列.任何时候,快速的 CRC-32 都会胜过加密安全的哈希.

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天全站免登陆