■ SHA512Managed 클래스 : SHA512 해시값 구하기

----------------------------------------------------------------------------------------------------

using System;

using System.Text;

using System.Security.Cryptography;

 

#region SHA512 해시값 구하기 - GetSHA512Hash(plainText)

 

/// <summary>

/// SHA512 해시값 구하기

/// </summary>

/// <param name="plainText">평문 텍스트</param>

/// <returns>SHA512 해시값</returns>

public string GetSHA512Hash(string plainText)

{

    SHA512 sha = new SHA512Managed();

 

    byte[] hashArray = sha.ComputeHash(Encoding.ASCII.GetBytes(plainText));

 

    string hashText = Convert.ToBase64String(hashArray);

 

    return hashText;

}

 

#endregion

----------------------------------------------------------------------------------------------------

Posted by 사용자 icodebroker
TAG