Пример #1
0
        private async ValueTask <FileInformation> LoadLargeFile(IFile file)
        {
            await using var fileStream = file.OpenRead();
            var hash = _fileHasher.ComputeHash(fileStream);

            return(new FileInformation(file.Filename, file.CreatedOn, file.ModifiedOn, hash, file.Length, file.CreatedOn, null, file.RelativeFilename));
        }
Пример #2
0
 private Hash ComputeHash(IFile file)
 {
     using var stream = file.OpenRead();
     return(_fileHasher.ComputeHash(stream));
 }