CSharp examples for System.Security.Cryptography:SHA1
Calculate SHA1 hash from given string
using System.Text; using System.Security.Cryptography; using System;// w w w . j ava 2 s . c o m public class Main{ /// <summary> /// Calculate SHA1 hash from given string /// </summary> public static byte[] CalculateSha1Hash(string val) { byte[] data = Encoding.UTF8.GetBytes(val); SHA1 sha = new SHA1Managed(); return sha.ComputeHash(data); } }