網上好多例子都是照抄的,512加密后亂碼。
找着個正確的Mark一下
public static string sha512Encode(string source) { string result = ""; byte[] buffer = Encoding.UTF8.GetBytes(source);//UTF-8 編碼 //64字節,512位 SHA512CryptoServiceProvider SHA512 = new SHA512CryptoServiceProvider(); byte[] h5 = SHA512.ComputeHash(buffer); result = BitConverter.ToString(h5).Replace("-", string.Empty); return result.ToLower(); }
轉自:https://blog.csdn.net/xawangxiangwei/article/details/51508261