示例#1
0
		void Test (string msg, byte[] data, string expected)
		{
			byte[] actual = new SHA512_256Managed ().ComputeHash (data);
			StringBuilder sb = new StringBuilder ();
			for (int i = 0; i < actual.Length; i ++)
				sb.Append (actual[i].ToString ("x2"));
			Assert.AreEqual (expected.ToLower(), sb.ToString(), "ComputeHash #" + msg);
		}
示例#2
0
		public void PropertyTest ()
		{
			SHA512_256Managed sha = new SHA512_256Managed ();
			Assert.AreEqual (256, sha.HashSize);
		}