gpt4 book ai didi

C# DotNetZip 错误 : The final hash has not been computed. 在 Ionic.Zip.WinZipAesCipherStream.get_FinalAuthentication()

转载 作者:行者123 更新时间:2023-12-03 17:33:32 25 4
gpt4 key购买 nike

大多数情况下,这段代码都可以工作,但是,大约有 1/3 的时间,它通过了大约 80% 的时间并失败了。解压缩 x 射线图像文件时解压缩失败。 (它们是没有文件扩展名的编号文件。)它似乎在大部分时间都能处理它们,但是,每隔一段时间就会有一个无法解压缩的 X 射线。当它在文件上失败时,它会给它一个带有随机扩展名的随机文件名。它似乎在解压缩时遇到了它不理解的字符组合。

它特别发生在 aes 加密的 zip 文件中。如果他们发送没有 aes 加密压缩的相同文件,那么程序会很好地解压缩它们。

当我使用 7zip 应用程序手动解压缩同一个 zip 文件时,我输入了相同的密码并且它工作得很好。

前任。文件应该是:00043 ==> 解压失败产生:1hzcqoee.nss

错误信息:

The final hash has not been computed.



堆栈跟踪:

at Ionic.Zip.WinZipAesCipherStream.get_FinalAuthentication() at Ionic.Zip.ZipEntry.VerifyCrcAfterExtract(Int32 calculatedCrc32, EncryptionAlgorithm encryptionAlgorithm, Int32 expectedCrc32, Stream archiveStream, Int64 uncompressedSize) at Ionic.Zip.ZipEntry.ExtractToStream(Stream archiveStream, Stream output, EncryptionAlgorithm encryptionAlgorithm, Int32 expectedCrc32) at Ionic.Zip.ZipEntry.InternalExtractToBaseDir(String baseDir, String password, ZipContainer zipContainer, ZipEntrySource zipEntrySource, String fileName) at Ionic.Zip.ZipFile._InternalExtractAll(String path, Boolean overrideExtractExistingProperty) at RHASystem64.ProcessNewVisitUpload.ExtractZip(String zipToUnpack, String unpackDirectory)



代码:
using Ionic.Zip;
public bool ExtractZip(string zipToUnpack, string unpackDirectory)
{
using (ZipFile zip1 = ZipFile.Read(zipToUnpack))
{
foreach (ZipEntry z in zip1)
{
if (z.FileName.Contains(".mdf"))
{
foundMDF = true;
isEncrypted = z.UsesEncryption;
}
}
if(isEncrypted)
zip1.Password = zipPass;

zip1.ExtractAll(unpackDirectory, ExtractExistingFileAction.DoNotOverwrite);
ExtractSuccess = true;
}
return ExtractSuccess;
}

我什至尝试使用以下行添加第二次尝试,它产生相同的结果。
zip1.ParallelDeflateThreshold = -1;

有没有人处理过这个错误?请帮我解决这个哈希错误!谢谢!

最佳答案

万一它发生在其他人身上,这是一个错误,它得到了修复
https://github.com/haf/DotNetZip.Semverd/issues/201
所以,更新你的nuget。

关于C# DotNetZip 错误 : The final hash has not been computed. 在 Ionic.Zip.WinZipAesCipherStream.get_FinalAuthentication(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50222814/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com