Beispiel #1
0
        private ContentHash CalculateHashWithMemoryMappedFile(IAbsFileSystem fileSystem, AbsolutePath path, HashType hashType)
        {
#if NET_COREAPP
            using var file = fileSystem.OpenForHashing(path);

            return(file.ToFileStream().HashFile(hashType));
#else
            return(fileSystem.CalculateHashAsync(path, hashType).GetAwaiter().GetResult());
#endif
        }