Skip to content

Commit

Permalink
Added ComputeMD5Hash and ComputeSHA1Hash extension methods
Browse files Browse the repository at this point in the history
  • Loading branch information
gordon-matt committed Dec 4, 2021
1 parent 7e2380a commit 4b3101f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Extenso.AspNetCore.Mvc/Rendering/FluentTagBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,10 @@ public class FluentTagBuilder

public FluentTagBuilder(string tagName, TagRenderMode renderMode = TagRenderMode.Normal, FluentTagBuilder parent = null)
{
tagBuilder = new TagBuilder(tagName);
tagBuilder.TagRenderMode = renderMode;
tagBuilder = new TagBuilder(tagName)
{
TagRenderMode = renderMode
};
this.parent = parent;
stringBuilder = new StringBuilder();
}
Expand Down
10 changes: 10 additions & 0 deletions Extenso.Core/ObjectExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,16 @@ public static void BinarySerialize<T>(this T source, string fileName)
}
}

public static byte[] ComputeMD5Hash(this object source)
{
return ComputeHash(source, new MD5CryptoServiceProvider());
}

public static byte[] ComputeSHA1Hash(this object source)
{
return ComputeHash(source, new SHA1CryptoServiceProvider());
}

/// <summary>
/// Returns an object of the specified type and whose value is equivalent to the specified object.
/// </summary>
Expand Down

0 comments on commit 4b3101f

Please sign in to comment.