Table of contents Home page
using System; using System.Security.Cryptography; using System.Text; public class Program { public static void Main() { string text = "Zoals het klokje thuis tikt, tikt het nergens."; Console.WriteLine("text: {0}", text); SHA1 sha = new SHA1Managed(); ASCIIEncoding ae = new ASCIIEncoding(); Console.Write("hash: "); byte[] data = ae.GetBytes(text); byte[] hash = sha.ComputeHash(data); for (int i = 0; i < hash.Length; i++) { Console.Write(String.Format(" {0:x}", hash[i])); } Console.WriteLine(""); Console.ReadKey(); } }