Unity3D - MD5 암호화

자료를 찾아서 찾은 유닛의 MD5 암호화 기법입니다. 여기에 참고하시기 바랍니다.
using UnityEngine;
using System.Collections.Generic;
using System.Text;
using System;

public class Md5 : MonoBehaviour {
    public static string Md5Sum(string strToEncrypt)
    {
        byte[] bs = UTF8Encoding.UTF8.GetBytes (strToEncrypt);
        System.Security.Cryptography.MD5 md5 = System.Security.Cryptography.MD5CryptoServiceProvider.Create ();

        byte[] hashBytes = md5.ComputeHash (bs);

        string hashString = "";
        for (int i = 0; i < hashBytes.Length; i++) {
            hashString += System.Convert.ToString (hashBytes [i], 16).PadLeft (2, '0');
        }
        return hashString.PadLeft (32, '0');
    }
}

좋은 웹페이지 즐겨찾기