This repository has been archived by the owner on May 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Adam Shirt
committed
Mar 7, 2020
1 parent
356b3fa
commit cbc27da
Showing
2 changed files
with
23 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters