Created
June 7, 2013 09:00
-
-
Save bitsprint/5727994 to your computer and use it in GitHub Desktop.
Security Module
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
| namespace Core.Security | |
| { | |
| using System.Security.Cryptography; | |
| using System.Text; | |
| public class SecurityModule | |
| { | |
| public static string GetMd5Hash(string input) | |
| { | |
| var md5 = MD5.Create(); | |
| var computeHash = md5.ComputeHash(Encoding.UTF8.GetBytes(input)); | |
| var stringBuilder = new StringBuilder(); | |
| for (var i = 0; i < computeHash.Length; i++) | |
| { | |
| stringBuilder.Append(computeHash[i].ToString("x2")); | |
| } | |
| return stringBuilder.ToString(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment