請得要用 using 來初始化物件 或是 dispose
using(var provider = new SHA512CryptoServiceProvider())
{
byte[] hashvalue2 = provider.ComputeHash(data2ToHash);
return BitConverter.ToString(hashvalue2).Replace("-", "").ToLower();
}