DoFinal() публичный Метод

public DoFinal ( byte output, int outOff ) : int
output byte
outOff int
Результат int
Пример #1
0
		public static uint256 Hash256(byte[] data, int offset, int count)
		{
#if USEBC || WINDOWS_UWP
			Sha256Digest sha256 = new Sha256Digest();
			sha256.BlockUpdate(data, offset, count);
			byte[] rv = new byte[32];
			sha256.DoFinal(rv, 0);
			sha256.BlockUpdate(rv, 0, rv.Length);
			sha256.DoFinal(rv, 0);
			return new uint256(rv);
#else
			using(var sha = new SHA256Managed())
			{
				var h = sha.ComputeHash(data, offset, count);
				return new uint256(sha.ComputeHash(h, 0, h.Length));
			}
#endif
		}
Пример #2
0
		public static byte[] SHA256(byte[] data, int offset, int count)
		{
#if USEBC || WINDOWS_UWP
			Sha256Digest sha256 = new Sha256Digest();
			sha256.BlockUpdate(data, offset, count);
			byte[] rv = new byte[32];
			sha256.DoFinal(rv, 0);
			return rv;
#else
			using(var sha = new SHA256Managed())
			{
				return sha.ComputeHash(data, offset, count);
			}
#endif
		}