A .NET library for generating MD5 hashes for compatibility, plus SHA-256 and HMAC-SHA-256 for new integrity scenarios. It is available under the MIT License.
Use MD5 only for legacy compatibility and checksums. It is not encryption or password hashing.
Contributeusing MD5Hash;
using System;
namespace MyAppExample
{
public class MyApp
{
public void MyExample()
{
string hashByHelper = Hash.Content("123");
Console.WriteLine(hashByHelper);
//output: 202cb962ac59075b964b07152d234b70
string hashByExtension = "123".GetMD5();
Console.WriteLine(hashByExtension);
//output: 202cb962ac59075b964b07152d234b70
string sha256 = "123".GetSHA256();
string hmac = "123".GetHMACSHA256("a-secret-key");
}
}
}