在 Windows 上计算文件夹的校验和并在 linux 上验证
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5395060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
calculate checksum for a folder on windows and verify on linux
提问by BetaRide
I have the following requirement:
我有以下要求:
- Calculate one checksum (SHA1 preferred) from an entire folder. This has to be done on Windows.
- Move this folder from a Windows to a Linux box.
- Verify the entire folder against the hash value on the Linux box.
- 从整个文件夹计算一个校验和(首选 SHA1)。这必须在 Windows 上完成。
- 将此文件夹从 Windows 移动到 Linux 机器。
- 根据 Linux 机器上的哈希值验证整个文件夹。
Any ideas are welcome!
欢迎任何想法!
回答by tgharold
md5deep http://linhost.info/2010/02/checksum-a-directory-with-md5deep/
md5deep http://linhost.info/2010/02/checksum-a-directory-with-md5deep/
It's done using MD5, but allows you to calculate hashes for sub-directories and is supposedly cross-platform. It would not surprise me if there was a SHA version out there.
它是使用 MD5 完成的,但允许您计算子目录的哈希值,并且据说是跨平台的。如果那里有 SHA 版本,我不会感到惊讶。
Alternate solution would be to do the transfer with rsync over SSH (install Cygwin on the Windows box). Which will make sure that the destination matches the source.
替代解决方案是通过 SSH 使用 rsync 进行传输(在 Windows 机器上安装 Cygwin)。这将确保目标与源匹配。