티스토리 뷰
using System;
using System.Text;
using System.Security.Cryptography; namespace test
{
class Program
{
static void Main(string[] args)
{
string a = "a";
using System.Text;
using System.Security.Cryptography; namespace test
{
class Program
{
static void Main(string[] args)
{
string a = "a";
UTF8Encoding u8e = new UTF8Encoding();
byte[] buf = u8e.GetBytes(a);
byte[] buf = u8e.GetBytes(a);
SHA1 sha = new SHA1CryptoServiceProvider();
byte[] result = sha.ComputeHash(buf);
Console.WriteLine(Convert.ToBase64String(result));
Console.ReadKey();
}
}
}
byte[] result = sha.ComputeHash(buf);
Console.WriteLine(Convert.ToBase64String(result));
Console.ReadKey();
}
}
}
'C#' 카테고리의 다른 글
| 인자 없는 delegate 의 Invoke 쓰기. (0) | 2012.08.21 |
|---|---|
| .NET 4.0 에서 SQLite 쓰기위한 구문 (0) | 2012.08.20 |
| Form 하나 닫히면서 다른 폼(자식폼) 생성하기. (0) | 2012.08.06 |
| C# 소켓 서버 클라이언트를 통한 DB 검색 (3) (1) | 2012.07.13 |
| C# 소켓 서버 클라이언트를 통한 DB 검색 (2) (0) | 2012.07.12 |
