Created
March 13, 2018 15:55
-
-
Save danielts86/7bc729c00ebbb27f98d460b69eabd6e9 to your computer and use it in GitHub Desktop.
Hash by SHA1
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
byte[] HashSHA1(string phrase) | |
{ | |
if (phrase == null) | |
return null; | |
var encoder = new UTF8Encoding(); | |
var sha1Hasher = new SHA1CryptoServiceProvider(); | |
var hashedDataBytes = sha1Hasher.ComputeHash(encoder.GetBytes(phrase)); | |
return hashedDataBytes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment