/ Published in: C#
Expand |
Embed | Plain Text
namespace [[AppName]].Helpers { static public class Helper { /// <summary> /// Returns string into an MD5 encrypted 32 character string /// </summary> /// <param name="originalText">Extended Method, the original text value</param> /// <returns>MD5 encrypted string</returns> static public string ToEncodeMD5(this string originalText) { System.Security.Cryptography.MD5CryptoServiceProvider x = new System.Security.Cryptography.MD5CryptoServiceProvider(); byte[] data = System.Text.Encoding.ASCII.GetBytes(originalText); data = x.ComputeHash(data); string ret = ""; for (int i = 0; i < data.Length; i++) ret += data[i].ToString("x2").ToLower(); return ret; } } }
You need to login to post a comment.
