Esempio n. 1
0
        public async Task <HashValue> GetFileHash(FileInfo file, CancellationToken cancel)
        {
            if (file.Length > 0)
            {
                using (var stream = file.OpenRead())
                {
                    return(await hashFunction.ComputeHashAsync(stream, cancel));
                }
            }

            return(hashFunction.HashOfEmpty);
        }