Advertisement
CGC_Codes

HashAlgorithm.create

Feb 20th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.45 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. using System.Security.Cryptography
  4.  
  5. class MainClass {
  6.     public static void Main(string[] args) {
  7.         using (HashAlgorithm hashAlg = HashAlgorithm.Create(args[0])) {
  8.             using (Stream file = new FileStream(args[1], FileMode.Open, FileAccess.read)) {
  9.                 byte[] hash = hashAlg.ComputerHash(file);
  10.  
  11.                 Console.WriteLine(BitConverter.ToString(hash));
  12.             }
  13.         }
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement