new SHA1Managed() : SHA1Managed « System.Security.Cryptography « C# / C Sharp by API






new SHA1Managed()

  
using System;
using System.Text;
using System.Security.Cryptography;

class MainClass {
    public static void Main(string[] args) {
        HashAlgorithm hashAlg = null;
        hashAlg = new SHA1Managed();
        using (hashAlg) {
            byte[] pwordData = Encoding.Default.GetBytes(args[1]);

            byte[] hash = hashAlg.ComputeHash(pwordData);

            Console.WriteLine(BitConverter.ToString(hash));
        }
    }
}

   
    
  








Related examples in the same category