private Task <bool> VerifyContentAsync(byte [] bytes, DedupNode expectedNode) { return(ChunkDedupedFileContentHashVerifier.VerifyStreamAsync( new MemoryStream(bytes), expectedNode.GetChunks().ToList(), new ChunkDedupedFileContentHash(expectedNode.Hash.Take(DedupSingleChunkHashInfo.Length).ToArray()), CancellationToken.None)); }
protected void HashCanBeVerified(DedupNode node, byte[] bytes, string expectedHash, int seed) { List <ChunkInfo> chunks = node.GetChunks().ToList(); using (var stream = new MemoryStream(bytes)) { bool hashMatch = ChunkDedupedFileContentHashVerifier.VerifyStreamAsync(stream, chunks, new ChunkDedupedFileContentHash(expectedHash), CancellationToken.None) .ConfigureAwait(false).GetAwaiter().GetResult(); Assert.True(hashMatch); } }