HashLib4CSharp is a comprehensive and easy to use hashing library written in C#. it provides flexible interfaces that makes usage a breeze. Hashing can be done in single pass or incremental mode. it also provides methods to clone the internal state of each hash object.
HashLib4CSharp's
goal is to be the best option for hashing in C# by offering various hashing primitives via an easy to use API to C# developers.
Development is coordinated on GitHub and contributions are welcome. If you need help, please open an issue here.
All functionality of the library is tested using nunit.
using System;
using System.Text;
using HashLib4CSharp.Base;
public class Program
{
public static void Main()
{
// single line mode
var result = HashFactory.Crypto.CreateMD5().ComputeString("Hello C#", Encoding.UTF8).ToString();
Console.WriteLine(result);
// split mode
var hash = HashFactory.Crypto.CreateMD5();
hash.Initialize();
hash.TransformString("Hello", Encoding.UTF8);
hash.TransformString(" C#", Encoding.UTF8);
result = hash.TransformFinal().ToString();
Console.WriteLine(result);
}
}
More usage samples can be found in HashLib4CSharp.Tests
folder.
- 💵 Bitcoin:
1MhFfW7tDuEHQSgie65uJcAfJgCNchGeKf
- 💶 Ethereum:
0x6c1DC21aeC49A822A4f1E3bf07c623C2C1978a98
- 💷 Pascalcoin:
345367-40