简体   繁体   English

如何验证 Windows 和 Linux 之间的校验和

[英]How to verify checksums between Windows and Linux

I have Jenkins build that reads a file from an Azure DevOps repository and runs a .NET dll that verifies the SHA256 of that file against the SHA256 provided in a manifest file.我有一个 Jenkins 构建,它从 Azure DevOps 存储库读取文件并运行一个 .NET dll,该 dll 会根据清单文件中提供的 SHA256 验证该文件的 SHA256。 Unfortunately, Jenkins runs on Linux and does a phantom update to the line endings before processing the file with the piece of .NET code that causes the checksums to mismatch because the checksum in the manifest is calculated in Windows.不幸的是,Jenkins 在 Linux 上运行并在使用 .NET 代码处理文件之前对行尾进行幻影更新,这会导致校验和不匹配,因为清单中的校验和是在 Windows 中计算的。 I have even tried updating manually updating the line endings from \\r\\n to \\n in notepad++ and updating the manifest with the resulting checksum but it is still failing.我什至尝试在记事本++中手动更新行结尾从 \\r\\n 到 \\n 并使用结果校验和更新清单,但它仍然失败。 Does anyone here have a suggestion of how to avoid this discrepancy?这里有人对如何避免这种差异有建议吗?

Manually updating the file might not be a good idea, but you could try to apply a line break normalization function.手动更新文件可能不是一个好主意,但您可以尝试应用换行规范化功能。 Depending on the technology you are using, there will be most likely a normalization function included.根据您使用的技术,很可能会包含归一化功能。 If it's a line break / compatibility problem, this should usually fix it.如果是换行符/兼容性问题,这通常应该可以解决。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Windows 2008服务器和Linux服务器之间交换数据 - How to exchange data between a windows 2008 server and a linux server 创建一个在Linux和Windows之间共享的nuget - create a nuget to share between linux and windows 如何在Linux上运行的python脚本与Windows上运行的.NET C#应用程序之间建立通信? - How to establish communication between a python script running on Linux with a .NET C# application running on windows? 如何验证Windows服务是否已停止或正在运行,并等待直到它处于这种状态? - How to verify if a windows service is stopped or running and wait until it is in this state? natvie windows DLL 和 Shared Linux Libraries .SO 之间是否有任何等价性 - Is there any equivalence between natvie windows DLL and Shared Linux Libraries .SO Windows / Linux之间的Unison同步在传输过程中随机挂起 - Unison sync between Windows/Linux hangs randomly during transfer Linux上的Mono和Windows上的.NET有多可靠? - How Reliable is Mono on Linux vs .NET on Windows? 如何使用Windows应用程序驱动程序在UI自动化单元测试期间验证WPF复选框的状态? - How can I verify the state of a WPF checkbox during a UI Automation Unit Test using the Windows Application Driver? 两台计算机之间基于COM的软件控制,从Linux到Windows - COM-based software control between two computers, and from Linux to Windows 在C#中使用pscp通过post请求在Windows和Linux之间传输文件 - Using pscp in C# for file transfer between Windows and Linux through a post request
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM