ya0911

花开花落也只是一瞬间的事情。

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

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

namespace ASPNET.StarterKit.Commerce.Components
{
 /// <summary>
 /// Summary description for Security.
 /// </summary>
 public class Security
 {
  //*********************************************************************
  //
  // Security.Encrypt() Method
  //
  // The Encrypt method encrypts a clean string into a hashed string
  //
  //*********************************************************************
  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 2005-02-21 19:23  ya0911  阅读(467)  评论(0编辑  收藏  举报