MD5加密

using System;
using System.Security.Cryptography;
using System.Text;
using System.Text.RegularExpressions;


    public class Security
    {
        public static string Encrypt(string cleanString)
        {
            Byte[] clearBytes = new UnicodeEncoding().GetBytes(cleanString);
            Byte[] hashedBytes = ((HashAlgorithm)CryptoConfig.CreateFromName("MD5")).ComputeHash(clearBytes);

            return BitConverter.ToString(hashedBytes);
        }
    }

 
posted on 2007-04-07 22:24  上校  阅读(243)  评论(0编辑  收藏  举报