mirror of
https://github.com/claunia/apprepodbmgr.git
synced 2025-12-16 19:24:42 +00:00
Fix hashing.
This commit is contained in:
@@ -454,7 +454,6 @@ namespace apprepodbmgr.Core
|
|||||||
|
|
||||||
byte[] dataBuffer;
|
byte[] dataBuffer;
|
||||||
Sha256Context sha256Context = new Sha256Context();
|
Sha256Context sha256Context = new Sha256Context();
|
||||||
sha256Context.Init();
|
|
||||||
|
|
||||||
if(fileStream.Length > BUFFER_SIZE)
|
if(fileStream.Length > BUFFER_SIZE)
|
||||||
{
|
{
|
||||||
@@ -887,6 +886,8 @@ namespace apprepodbmgr.Core
|
|||||||
FileStream outFs = new FileStream(Path.Combine(Context.Path, file.Path), FileMode.CreateNew,
|
FileStream outFs = new FileStream(Path.Combine(Context.Path, file.Path), FileMode.CreateNew,
|
||||||
FileAccess.Write);
|
FileAccess.Write);
|
||||||
|
|
||||||
|
long inLength = inFs.Length;
|
||||||
|
|
||||||
switch(algorithm)
|
switch(algorithm)
|
||||||
{
|
{
|
||||||
case AlgoEnum.GZip:
|
case AlgoEnum.GZip:
|
||||||
@@ -924,8 +925,8 @@ namespace apprepodbmgr.Core
|
|||||||
zStream.Read(buffer, 0, buffer.Length);
|
zStream.Read(buffer, 0, buffer.Length);
|
||||||
outFs.Write(buffer, 0, buffer.Length);
|
outFs.Write(buffer, 0, buffer.Length);
|
||||||
|
|
||||||
UpdateProgress2?.Invoke($"{file.Length / (double)file.Length:P}", "Finishing...", inFs.Length,
|
UpdateProgress2?.Invoke($"{file.Length / (double)file.Length:P}", "Finishing...", inLength,
|
||||||
inFs.Length);
|
inLength);
|
||||||
|
|
||||||
zStream.Close();
|
zStream.Close();
|
||||||
outFs.Close();
|
outFs.Close();
|
||||||
|
|||||||
Reference in New Issue
Block a user