Hash for checking upload/download, waiting screen

This commit is contained in:
Aurélie Delhaie
2022-06-16 22:44:53 +02:00
parent 24a04e8c02
commit 2a9fd72e14
17 changed files with 691 additions and 80 deletions

View File

@@ -79,5 +79,16 @@ namespace OpenSaveCloudClient.Core
return sha.ComputeHash(inputStream);
}
public static string? HashFile(string path)
{
FileInfo fileInfo = new(path);
byte[]? hash = HashFile(fileInfo);
if (hash == null)
{
throw new InvalidOperationException("HashFile: file to get hash");
}
return BitConverter.ToString(hash).Replace("-", "");
}
}
}