MD5 2.2.5
dotnet add package MD5 --version 2.2.5
NuGet\Install-Package MD5 -Version 2.2.5
<PackageReference Include="MD5" Version="2.2.5" />
paket add MD5 --version 2.2.5
#r "nuget: MD5, 2.2.5"
// Install MD5 as a Cake Addin #addin nuget:?package=MD5&version=2.2.5 // Install MD5 as a Cake Tool #tool nuget:?package=MD5&version=2.2.5
MD5
Overview
MD5 is a .NET library that provides methods to generate MD5 hash from string, byteArray, object or stream content. It uses the System.Security.Cryptography.MD5 class to generate the hash.
Usage
To use the library, you can call the GetMD5
method on a string, byteArray, object or stream to get the MD5 hash.
Examples:
string hash1 = "hello world".GetMD5();
// or specific encoding type
string hash2 = "hello world".GetMD5(EncodingType.UTF8);
var stream = File.OpenRead("Rondonia.pdf");
string hash = stream.GetMD5();
byte[] byteArray = Encoding.UTF8.GetBytes("Hello, World!");
string hash = byteArray.GetMD5();
BrasilModel obj = new BrasilModel() { Id = 1, Details = "Maior país da América do Sul" };
string hash = obj.GetMD5();
To number you can use:
string hash = myNumber.ToString().GetMD5():
New Feature: MD5 with Salt
This new feature allows you to generate a salted MD5 hash, enhancing security.
Usage
To use the salted hash functionality, you can call the GetMD5WithSalt
method on a string, byteArray, or object to get the MD5 hash with a salt.
Examples:
string salt = "randomSalt";
string hash1 = "hello world".GetMD5WithSalt(salt);
// or specific encoding type
string hash2 = "hello world".GetMD5WithSalt(salt, EncodingType.UTF8);
byte[] byteArray = Encoding.UTF8.GetBytes("Hello, World!");
byte[] saltBytes = Encoding.UTF8.GetBytes("randomSalt");
string hash = byteArray.GetMD5WithSalt(saltBytes);
BrasilModel obj = new BrasilModel() { Id = 1, Details = "Maior país da América do Sul" };
string salt = "randomSalt";
string hash = obj.GetMD5WithSalt(salt);
To number you can use:
string salt = "randomSalt";
string hash = myNumber.ToString().GetMD5WithSalt(salt);
Installation
You can install the library via NuGet package manager by searching for MD5 or by executing the following command in the Package Manager Console:
PM> Install-Package MD5
License
This library is licensed under the MIT License. See the LICENSE file for more details.
Contributions
Contributions to this library are welcome. Please open an issue or submit a pull request with your changes.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Newtonsoft.Json (>= 13.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
added suport to MD5 with Salt