Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
22
Task/SHA-256/C-sharp/sha-256.cs
Normal file
22
Task/SHA-256/C-sharp/sha-256.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace RosettaCode.SHA256
|
||||
{
|
||||
[TestClass]
|
||||
public class SHA256ManagedTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestComputeHash()
|
||||
{
|
||||
var buffer = Encoding.UTF8.GetBytes("Rosetta code");
|
||||
var hashAlgorithm = new SHA256Managed();
|
||||
var hash = hashAlgorithm.ComputeHash(buffer);
|
||||
Assert.AreEqual(
|
||||
"76-4F-AF-5C-61-AC-31-5F-14-97-F9-DF-A5-42-71-39-65-B7-85-E5-CC-2F-70-7D-64-68-D7-D1-12-4C-DF-CF",
|
||||
BitConverter.ToString(hash));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue