Advertisement
TopFloorSolutions

SHA256 Hash

Jan 23rd, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1. using System.Security.Cryptography;
  2. using System.Text;
  3.  
  4. namespace CryptoGnome.Hashes
  5. {
  6.     /// <summary>
  7.     /// SHA256 hash function class.
  8.     /// </summary>
  9.     public class MySHA256 : ISha256
  10.     {
  11.         private SHA256Managed _sha256;
  12.         SHA256Managed ISha256.sha256
  13.         {
  14.             get
  15.             {
  16.                 return _sha256;
  17.             }
  18.  
  19.             set
  20.             {
  21.                 value = _sha256;
  22.             }
  23.         }
  24.  
  25.         // Get the bytes from the hash/encoding.
  26.         public byte[] ShakeSha(string x) => _sha256.ComputeHash(Encoding.UTF8.GetBytes(x)));
  27.          
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement