public byte[] ComputeHash() { var sha2 = new SHA256Managed(); Stream.Position = 0; return sha2.ComputeHash(Stream); }