using System; using System.Linq; using System.Security.Cryptography; using System.Text; using System.Data; using System.Collections.Generic; public class Program { public static void Main() { string xHasil; string xPassword = "String"; SHA512Managed sham = new SHA512Managed(); ASCIIEncoding ae = new ASCIIEncoding(); byte[] Hash = sham.ComputeHash(ae.GetBytes(xPassword.Trim())); StringBuilder sb = new StringBuilder(Hash.Length * 2); for (int idx = 0; idx <= Hash.Length - 1; idx++) { string temp = "0" + string.Format("{0:x4}", Hash[idx]); sb.Append(temp.Substring(temp.Length - 2)); } xHasil = sb.ToString().Trim().ToUpper(); return xHasil; } }