Skip to content

Commit 0af3438

Browse files
.
1 parent 0edc9d2 commit 0af3438

File tree

2 files changed

+13
-12
lines changed

2 files changed

+13
-12
lines changed

MD5CSharp/MD5.csproj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,14 @@
1111
<PackageIcon>logo.png</PackageIcon>
1212
<PackageIconUrl />
1313
<RepositoryUrl>https://github.com/oalexandrefreire/MD5</RepositoryUrl>
14-
<Version>2.0.4</Version>
14+
<Version>2.0.5</Version>
1515
<RepositoryType>git</RepositoryType>
1616
<AssemblyVersion>2.0.5</AssemblyVersion>
1717
<FileVersion>2.0.5</FileVersion>
1818
<PackageReadmeFile>README.md</PackageReadmeFile>
1919
<PackageProjectUrl>https://github.com/oalexandrefreire/MD5</PackageProjectUrl>
20-
<PackageReleaseNotes>added suport to byteArray and stream</PackageReleaseNotes>
20+
<PackageReleaseNotes>added suport to objects
21+
removed duplicated codes from Hash.cs</PackageReleaseNotes>
2122
</PropertyGroup>
2223

2324
<ItemGroup>

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
![Nuget](https://img.shields.io/nuget/dt/md5)
1+
![Nuget](https://img.shields.io/nuget/dt/md5)
22
![Nuget](https://img.shields.io/nuget/v/md5)
33

44
# MD5
@@ -7,15 +7,17 @@
77

88
## Overview
99

10-
MD5 is a .NET library that provides methods to generate MD5 hash from string, byteArray or stream content. It uses the System.Security.Cryptography.MD5 class to generate the hash.
10+
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.
1111

1212
## Usage
1313

14-
To use the library, you can call the `GetMD5` method on a string, byteArray or stream to get the MD5 hash.
14+
To use the library, you can call the `GetMD5` method on a string, byteArray, object or stream to get the MD5 hash.
1515
Examples:
1616

1717
```csharp
18-
string hash = "hello world".GetMD5();
18+
string hash1 = "hello world".GetMD5();
19+
// or specific encoding type
20+
string hash2 = "hello world".GetMD5(EncodingType.UTF8);
1921
```
2022
```csharp
2123
var stream = File.OpenRead("Rondonia.pdf");
@@ -25,17 +27,15 @@ string hash = stream.GetMD5();
2527
byte[] byteArray = Encoding.UTF8.GetBytes("Hello, World!");
2628
string hash = byteArray.GetMD5();
2729
```
28-
To number you can use:
2930
```csharp
30-
string hash = myNumber.ToString().GetMD5():
31+
BrasilModel obj = new BrasilModel() { Id = 1, Details = "Maior país da América do Sul" };
32+
string hash = obj.GetMD5();
3133
```
32-
You can also call the Content method on the MD5Hash.Hash class to get the hash from a string, byteArray or Stream
33-
34+
To number you can use:
3435
```csharp
35-
string hash = MD5Hash.Hash.Content("hello world");
36+
string hash = myNumber.ToString().GetMD5():
3637
```
3738

38-
3939
## Installation
4040
You can install the library via NuGet package manager by searching for MD5 or by executing the following command in the Package Manager Console:
4141

0 commit comments

Comments
 (0)