HashAlgorithm : HashAlgorithm : Security C# Source Code


Custom Search

C# Source Code » Security » HashAlgorithm »

 

HashAlgorithm








    
 


using System;
using System.IO;
using System.Security.Cryptography;

class MainClass {
    public static void Main(string[] args) {
        using (HashAlgorithm hashAlg = HashAlgorithm.Create(args[0])) {
            using (Stream file = new FileStream(args[1], FileMode.Open, FileAccess.Read)) {
                byte[] hash = hashAlg.ComputeHash(file);

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

 
    
   
  
   







HTML code for linking to this page:

Follow Navioo On Twitter

C# Source Code

 Navioo Security
» HashAlgorithm