CSharp examples for System.Security.Cryptography:SHA1
Sha1 String hash
using System.Text; using System.Security.Cryptography; using System.Collections.Generic; using System;/* w w w. j a v a 2s.co m*/ public class Main{ public static string Sha1(string text) { byte[] buffer = Encoding.UTF8.GetBytes(text); SHA1CryptoServiceProvider cryptoTransformSHA1 = new SHA1CryptoServiceProvider(); byte[] outbuffer = cryptoTransformSHA1.ComputeHash(buffer); return Convert.ToBase64String(outbuffer); } }