new SHA1Managed() : SHA1Managed « Security « C# / C Sharp






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

1.Encrypt SHA1
2.Encrypt SHA256
3.Returns a SHA1 hash of a given plaintext
4.SHA256 crypt
5.Marshal Str
6.Get SHA1 for a string
7.Get SHA256 for a string
8.Get SHA38 for a string
9.Get SHA512 for a string
10.Encrypts a string using the SHA256 algorithm.