Skip to content

Instantly share code, notes, and snippets.

@bitsprint
Created June 7, 2013 09:00
Show Gist options
  • Select an option

  • Save bitsprint/5727994 to your computer and use it in GitHub Desktop.

Select an option

Save bitsprint/5727994 to your computer and use it in GitHub Desktop.
Security Module
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