feat(launcher): add verified first-run installer
This commit is contained in:
parent
60f627998c
commit
ff6ebb6a6a
28 changed files with 3259 additions and 125 deletions
|
|
@ -27,6 +27,11 @@ public static class FileIntegrity
|
|||
return Convert.ToHexStringLower(hash);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Asynchronous, cancellable counterpart used while verifying a multi-
|
||||
/// gigabyte prepared package. The file stays streamed and no buffer is
|
||||
/// retained after the hash completes.
|
||||
/// </summary>
|
||||
public static async Task<string> ComputeSha256HexAsync(
|
||||
string filePath,
|
||||
CancellationToken cancellationToken = default)
|
||||
|
|
@ -38,8 +43,8 @@ public static class FileIntegrity
|
|||
FileMode.Open,
|
||||
FileAccess.Read,
|
||||
FileShare.Read,
|
||||
bufferSize: 4096,
|
||||
useAsync: true);
|
||||
bufferSize: 1024 * 1024,
|
||||
options: FileOptions.Asynchronous | FileOptions.SequentialScan);
|
||||
byte[] hash = await SHA256.HashDataAsync(stream, cancellationToken)
|
||||
.ConfigureAwait(false);
|
||||
return Convert.ToHexStringLower(hash);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue