Skip to content
Alexandre Freire edited this page Aug 1, 2023 · 1 revision

Usage

To use the library, you can call the GetMD5 method on a string, byteArray or stream to get the MD5 hash. Examples:

string hash = "hello world".GetMD5();
var stream = File.OpenRead("Rondonia.pdf");
string hash = stream.GetMD5();
byte[] byteArray = Encoding.UTF8.GetBytes("Hello, World!");
string hash = byteArray.GetMD5();

To number you can use:

string hash = myNumber.ToString().GetMD5():

You can also call the Content method on the MD5Hash.Hash class to get the hash from a string, byteArray or Stream

string hash = MD5Hash.Hash.Content("hello world");

Clone this wiki locally