From cbc27da53c1f7637ee00c02944dc98501f0c6b7b Mon Sep 17 00:00:00 2001 From: Adam Shirt Date: Sat, 7 Mar 2020 16:17:52 +0000 Subject: [PATCH] Include Sha3 hashing library --- .../Hashing/Sha3Extensions.cs | 18 ++++++++++++++++++ .../SmartContract.Essentials.csproj | 6 +++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/SmartContract.Essentials/Hashing/Sha3Extensions.cs diff --git a/src/SmartContract.Essentials/Hashing/Sha3Extensions.cs b/src/SmartContract.Essentials/Hashing/Sha3Extensions.cs new file mode 100644 index 0000000..b0c1884 --- /dev/null +++ b/src/SmartContract.Essentials/Hashing/Sha3Extensions.cs @@ -0,0 +1,18 @@ +using SHA3.Net; +using System.Text; + +namespace SmartContract.Essentials.Hashing +{ + public static class Sha3Extensions + { + /// + /// Computes the hash value for the specified string + /// + /// + /// + public static byte[] ComputeHash(this Sha3 hasher, string value) + { + return hasher.ComputeHash(Encoding.UTF8.GetBytes(value)); + } + } +} diff --git a/src/SmartContract.Essentials/SmartContract.Essentials.csproj b/src/SmartContract.Essentials/SmartContract.Essentials.csproj index 2d4f3d7..88d1433 100644 --- a/src/SmartContract.Essentials/SmartContract.Essentials.csproj +++ b/src/SmartContract.Essentials/SmartContract.Essentials.csproj @@ -12,7 +12,11 @@ https://github.com/drmathias/SmartContract.Essentials git blockchain encryption smart-contracts stratis neo - 1.0.2 + 1.0.3 + + + +