赞
踩
文件 校验 算法:MD5、SHA1、SHA256、SHA384、SHA512、CRC32、CRC64 (免费)
编程语言:C#
功能:文件 哈希 属性
校验算法:MD5、SHA1、SHA256、SHA384、SHA512、CRC32、CRC64。
下载(免费):https://download.csdn.net/download/polloo2012/88450148
本程序 File Properties and Hash Validation.exe 验证:
MD5: DD3BE641301A54E093CAC2C15823491A
SHA1: 711330AD0E0BB25D6E6E6AD2BE1ACEE1830C7FBD
SHA256: CEF9D7915425C96C6C73BF212D7C7E6D8A3D90028DFA4278B0E351B3C63BE3EA
SHA384: F6115FCF1C4E08A571D87441E72C163291677D5644A983CE8DD068F1B3386413CFC3390DF0AE47A41B5F90145F798C01
SHA512: 93DDBF61CA0F10500141AB6D78B156C2AB6EEA4A777A8C90D58F40D42BDF5CEE1E0DAAE0258ECB748640CFD07AB5B47EC97E28D929818250D8F1E613C4EF4BA6
CRC32: B5504085
CRC64: E9D486C6CF48506A
更新:2023年10月21日
1、注册windows右键 支持右键
更新时间:2023年10月26日 (不再更新)
1、普通 和 多线程(默认 多线程)
2、修改一些布局,增加 右下菜单
核心代码:
- using System;
- using System.Collections.Generic;
- using System;
- using System.Text;
- using System.Threading;
- using System.Security;
- using System.Security.Cryptography;
- using System.Data.HashFunction;
-
- namespace HashChecker
- {
- /// <summary>
- /// There are some kinds of hash algorithm in this class likes MD5, SHA1, SHA256, SHA384, SHA512, CRC32, CRC64.
- /// 此类提供MD5,SHA1,SHA256,SHA384,SHA512,CRC32,CRC64等几种数据摘要算法。
- /// </summary>
- public static class HashFunction
- {
- /// <summary>
- /// Caculate string's MD5 value. 计算字符串的MD5值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return MD5 value. 返回MD5值。</returns>
- public static string md5(string strIN)
- {
- return md5(System.Text.Encoding.Default.GetBytes(strIN));
- }
- /// <summary>
- /// Caculate string's MD5 value. 计算字符串的MD5值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return MD5 value. 返回MD5值。</returns>
- public static string md5(Byte[] btIN)
- {
- System.Security.Cryptography.MD5 md5 = new MD5CryptoServiceProvider();
- byte[] bytResult = md5.ComputeHash(btIN);
- md5.Clear();
- string strResult = BitConverter.ToString(bytResult);
- strResult = strResult.Replace("-", "");
- return strResult;
- }
-
- /// <summary>
- /// Caculate string's SHA1 value. 计算字符串的SHA1值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return SHA1 value. 返回SHA1值。</returns>
- public static string sha1(string strIN)
- {
- return sha1(System.Text.Encoding.Default.GetBytes(strIN));
- }
- /// <summary>
- /// Caculate string's SHA1 value. 计算字符串的SHA1值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return SHA1 value. 返回SHA1值。</returns>
- public static string sha1(byte[] btIN)
- {
- byte[] tmpByte;
- SHA1 sha1 = new SHA1CryptoServiceProvider();
- tmpByte = sha1.ComputeHash(btIN);
- sha1.Clear();
- string strResult = BitConverter.ToString(tmpByte);
- strResult = strResult.Replace("-", "");
- return strResult;
- }
-
- /// <summary>
- /// Caculate string's SHA256 value. 计算字符串的SHA256值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return SHA256 value. 返回SHA256值。</returns>
- public static string sha256(string strIN)
- {
- return sha256(System.Text.Encoding.Default.GetBytes(strIN));
- }
- /// <summary>
- /// Caculate string's SHA256 value. 计算字符串的SHA256值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return SHA256 value. 返回SHA256值。</returns>
- public static string sha256(byte[] btIN)
- {
- byte[] tmpByte;
- SHA256 sha256 = new SHA256Managed();
- tmpByte = sha256.ComputeHash(btIN);
- sha256.Clear();
- string strResult = BitConverter.ToString(tmpByte);
- strResult = strResult.Replace("-", "");
- return strResult;
- }
-
- /// <summary>
- /// Caculate string's SHA384 value. 计算字符串的SHA384值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return SHA384 value. 返回SHA384值。</returns>
- public static string sha384(string strIN)
- {
- return sha384(System.Text.Encoding.Default.GetBytes(strIN));
- }
- /// <summary>
- /// Caculate string's SHA384 value. 计算字符串的SHA384值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return SHA384 value. 返回SHA384值。</returns>
- public static string sha384(byte[] btIN)
- {
- byte[] tmpByte;
- SHA384 sha384 = new SHA384Managed();
- tmpByte = sha384.ComputeHash(btIN);
- sha384.Clear();
- string strResult = BitConverter.ToString(tmpByte);
- strResult = strResult.Replace("-", "");
- return strResult;
- }
-
- /// <summary>
- /// Caculate string's SHA512 value. 计算字符串的SHA512值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return SHA512 value. 返回SHA512值。</returns>
- public static string sha512(string strIN)
- {
- return sha512(System.Text.Encoding.Default.GetBytes(strIN));
- }
- /// <summary>
- /// Caculate string's SHA512 value. 计算字符串的SHA512值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return SHA512 value. 返回SHA512值。</returns>
- public static string sha512(byte[] btIN)
- {
- byte[] tmpByte;
- SHA512 sha512 = new SHA512Managed();
- tmpByte = sha512.ComputeHash(btIN);
- sha512.Clear();
- string strResult = BitConverter.ToString(tmpByte);
- strResult = strResult.Replace("-", "");
- return strResult;
- }
-
- /// <summary>
- /// Caculate string's CRC32 value. 计算字符串的循环冗余校验码CRC32值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return CRC32 value. 返回CRC32值。</returns>
- public static string crc32(string strIN)
- {
- return crc32(strIN);
- }
- /// <summary>
- /// Caculate string's CRC32 value. 计算字符串的循环冗余校验码CRC32值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return CRC32 value. 返回CRC32值。</returns>
- public static string crc32(byte[] btIN)
- {
- return crc_caculator(btIN, CRC.Standard.CRC32);
- }
-
- /// <summary>
- /// Caculate string's CRC64 value. 计算字符串的循环冗余校验码CRC64值。
- /// </summary>
- /// <param name="strIN">input string. 输入的字符串。</param>
- /// <returns>Return CRC64 value. 返回CRC64值。</returns>
- public static string crc64(string strIN)
- {
- return crc64(strIN);
- }
- /// <summary>
- /// Caculate string's CRC64 value. 计算字符串的循环冗余校验码CRC64值。
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <returns>Return CRC64 value. 返回CRC64值。</returns>
- public static string crc64(byte[] btIN)
- {
- return crc_caculator(btIN, CRC.Standard.CRC64);
- }
- /// <summary>
- /// CRC Caculator. CRC循环冗余校验码计算器
- /// </summary>
- /// <param name="btIN">input Byte Array. 输入的字节数组。</param>
- /// <param name="standard">CRC Standard. CRC计算标准。</param>
- /// <returns>Return CRC value. 返回CRC值。</returns>
- public static string crc_caculator(byte[] btIN, CRC.Standard standard)
- {
- CRC.Setting crcset = CRC.Standards[standard];
- System.Data.HashFunction.CRC crc = new CRC(crcset);
- byte[] tmpByte = crc.ComputeHash(btIN);
- string strResult = BitConverter.ToString(tmpByte);
- strResult = strResult.Replace("-", "");
- return strResult;
- }
- }
- }
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。