Код: Выделить всё
string fh;
using (SHA256 hash2 = SHA256.Create())
{
var cfs = new MemoryStream();
await finalBlobClient.DownloadToAsync(cfs);
cfs.Position = 0;
fh = BitConverter.ToString(hash2.ComputeHash(cfs)).Replace("-", "").ToUpper(); // cfs.ToArray().GetSha2Hash().ToString(); I also tried it like this but I got the same result
}
< /code>
Тогда я попробовал что -то подобное: < /p>
using (SHA256 hash = SHA256.Create())
{
byte[] chunkBytes = await ReadStreamToEndAsync(chunkData);
hash.TransformBlock(chunkBytes, 0, chunkBytes.Length, null, 0);
//... some other code for chunks and file uploading
hash.TransformFinalBlock(new byte[0], 0, 0);
string fileHash = BitConverter.ToString(hash.Hash).Replace("-", "").ToUpper();
}
Чего мне здесь не хватает?>
Подробнее здесь: https://stackoverflow.com/questions/794 ... the-result
Мобильная версия