Created
January 13, 2013 19:19
-
-
Save rodolfofadino/4525754 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public string GetHashFromFile(string localDoArquivo) | |
{ | |
using (HashAlgorithm hashAlgorithm = HashAlgorithm.Create("SHA1")) | |
{ | |
using (Stream stream = new FileStream(localDoArquivo, FileMode.Open, FileAccess.Read)) | |
{ | |
byte[] hash = hashAlgorithm.ComputeHash(stream); | |
return BitConverter.ToString(hash); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment