MD5 2.2.5

dotnet add package MD5 --version 2.2.5                
NuGet\Install-Package MD5 -Version 2.2.5                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MD5" Version="2.2.5" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add MD5 --version 2.2.5                
#r "nuget: MD5, 2.2.5"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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                

Nuget Nuget codecov

MD5

NuGet

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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
2.2.5 14,012 7/24/2024
2.1.5 10,083 4/25/2024
2.0.5 6,534 3/6/2024
2.0.4 43,827 8/1/2023
2.0.3 33,088 2/22/2023
2.0.2 56,102 3/25/2022
2.0.1 1,274 3/25/2022
2.0.0 15,137 3/11/2020
1.0.0 1,497 3/11/2020

added suport to MD5 with Salt