KeyLimeTie Blog

Convert Plain Text to MD5 Hash

By Brian Pautsch – 11/20/2007 10:08:32 PM. Posted to Code Snippets.

Nothing groundbreaking here, but if you need to know how to convert plain text to an MD5 Hash, here you go:

1using System;
2using System.Security.Cryptography;
3using System.Text;
4
5public static string ConvertToMD5(string plainText) 6{ 7 byte[] input = Encoding.UTF8.GetBytes(plainText); 8 byte[] output = MD5.Create().ComputeHash(input); 9 return Convert.ToBase64String(output).Trim(); 10}

/html>

Comments

Leave a Comment

Name:
Email:
URL:
Comment:
Security Code:
Type Security Code:

Photos on Flickr

More Photos »

Search Blog


Get Email Updates

Like what you read here at KeyLimeTie? Sign up for our email list!

Subscribe