all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
21
Task/SHA-1/C-sharp/sha-1.cs
Normal file
21
Task/SHA-1/C-sharp/sha-1.cs
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
namespace RosettaCode.SHA1
|
||||
{
|
||||
[TestClass]
|
||||
public class SHA1CryptoServiceProviderTest
|
||||
{
|
||||
[TestMethod]
|
||||
public void TestComputeHash()
|
||||
{
|
||||
var input = new UTF8Encoding().GetBytes("Rosetta Code");
|
||||
var output = new SHA1CryptoServiceProvider().ComputeHash(input);
|
||||
Assert.AreEqual(
|
||||
"48-C9-8F-7E-5A-6E-73-6D-79-0A-B7-40-DF-C3-F5-1A-61-AB-E2-B5",
|
||||
BitConverter.ToString(output));
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue