Skip to content
This repository has been archived by the owner on May 20, 2022. It is now read-only.

Commit

Permalink
Include Sha3 hashing library
Browse files Browse the repository at this point in the history
  • Loading branch information
Adam Shirt committed Mar 7, 2020
1 parent 356b3fa commit cbc27da
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
18 changes: 18 additions & 0 deletions src/SmartContract.Essentials/Hashing/Sha3Extensions.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using SHA3.Net;
using System.Text;

namespace SmartContract.Essentials.Hashing
{
public static class Sha3Extensions
{
/// <summary>
/// Computes the hash value for the specified string
/// </summary>
/// <exception cref="System.ArgumentNullException"></exception>
/// <exception cref="System.ObjectDisposedException"></exception>
public static byte[] ComputeHash(this Sha3 hasher, string value)
{
return hasher.ComputeHash(Encoding.UTF8.GetBytes(value));
}
}
}
6 changes: 5 additions & 1 deletion src/SmartContract.Essentials/SmartContract.Essentials.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
<RepositoryUrl>https://github.com/drmathias/SmartContract.Essentials</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>blockchain encryption smart-contracts stratis neo</PackageTags>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="SHA3.Net" Version="1.2.2" />
</ItemGroup>

</Project>

0 comments on commit cbc27da

Please sign in to comment.