- 如何使用 C# 对文件进行哈希处理
- 有什么可用的? (md5、crc、sha1 等)
- 是否有我应该继承的接口?
我想对多个文件进行校验和并将其存储在数据库中,并使用我自己的两个校验和/哈希。
1.) 如何使用 C# 对文件进行哈希处理?
您可以使用 .NET 类系统.安全.密码学 http://msdn.microsoft.com/en-us/library/system.security.cryptography.aspx
2.) 有什么可用的?
- 键控哈希算法 http://msdn.microsoft.com/en-us/library/system.security.cryptography.keyedhashalgorithm.aspx
- MD5 http://msdn.microsoft.com/en-us/library/system.security.cryptography.md5.aspx
- 成熟的MD160 http://msdn.microsoft.com/en-us/library/system.security.cryptography.ripemd160.aspx
- SHA1 http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha1.aspx
- SHA256 http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha256.aspx
- SHA384 http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha384.aspx
- SHA512 http://msdn.microsoft.com/en-us/library/system.security.cryptography.sha512.aspx
3.)是否有一个我应该继承的接口?
不,你不必这样做。
看一眼哈希算法.Create(...) http://msdn.microsoft.com/en-us/library/wet69s13.aspx
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)