해시와 인코딩 두개 함수.. ㅎㅎ
by picomax
# MD5 Hash Crypt
public static string MD5HashCrypt(string val) { byte[] data = Encoding.ASCII.GetBytes(val); MD5 md5 = new MD5CryptoServiceProvider(); byte[] result = md5.ComputeHash(data); //return Encoding.ASCII.GetString(result); return Convert.ToBase64String(result); }
# SHA1 Hash Crypt
public static string SHA1HashCrypt(string val) { byte[] data = Encoding.ASCII.GetBytes(val); SHA1 sha = new SHA1CryptoServiceProvider(); byte[] result = sha.ComputeHash(data); //return Encoding.ASCII.GetString(result); return Convert.ToBase64String(result); }