在 C# 中散列 SHA1 大文件(超过 2gb) [英] Hash SHA1 large files (over 2gb) in C#

查看:21
本文介绍了在 C# 中散列 SHA1 大文件(超过 2gb)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找散列大文件内容的解决方案(文件在 32 位操作系统中可能超过 2GB).有什么简单的解决方案吗?还是只是逐个读取并加载到缓冲区?

I`m looking for solution for hashing large file content (files may be over 2gb in 32bit os). It there any easy solution for that? Or just reading by part and loading to buffer?

推荐答案

Driis 的解决方案听起来更灵活,但 HashAlgorithm.ComputeHash 也将接受 Streams 作为参数.

Driis's solution sounds more flexible, but HashAlgorithm.ComputeHash will also accept Streams as parameters.

这篇关于在 C# 中散列 SHA1 大文件(超过 2gb)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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