public static string GetHash([NotNull] IFileInfo file) { try { using (var stream = file.CreateReadStreamWithRetry()) { return(Crc32.Calculate(stream).ToString(CultureInfo.InvariantCulture)); } } catch (IOException) { // Don't throw if reading the file fails. } return(string.Empty); }