C#之Hash值

1.生成512位哈希值

	private string GetHash_512(string strPlain)
	{
		SHA512Managed sha512 = new SHA512Managed();
		string strHash = string.Empty;
		byte[] btHash = sha512.ComputeHash(UnicodeEncoding.Unicode.GetBytes(strPlain));
		for (int i = 0; i < btHash.Length; i++)
		{
			strHash = strHash + Convert.ToString(btHash[i], 16);
		}
		return strHash;
	}

你可能感兴趣的:(C#,c#,哈希算法,java)