'md5'에 해당되는 글 2건

  1. 2012.03.04 C# MD5 해쉬값 생성
  2. 2009.12.16 VB.NET 에서 md5 해시코드 생성
public static string MD5(string password) {
   byte[] textBytes = System.Text.Encoding.Default.GetBytes(password);
   try {
      System.Security.Cryptography.MD5CryptoServiceProvider cryptHandler;
      cryptHandler = new System.Security.Cryptography.MD5CryptoServiceProvider();
      byte[] hash = cryptHandler.ComputeHash (textBytes);
      string ret = "";
      foreach (byte a in hash) {
         if (a<16)
            ret += "0" + a.ToString ("x");
         else
            ret += a.ToString ("x");
      }
      return ret ;
   }
   catch {
      throw;
   }
}
Posted by 철냄비짱
,

Dim Hash As Byte() = _

new System.Security.Cryptography.MD5CryptoServiceProvider().ComputeHash(arg)

Dim i As Long

Dim RetStr As String = ""

For i = 0 To UBound(Hash)

    RetStr &= Format(Hash(i), "00")

Next

Return RetStr

출처 : http://blog.naver.com/gewehr43?Redirect=Log&logNo=100035915336

Posted by 철냄비짱
,