注意:这篇文章上次更新于2011天前,文章内容可能已经过时。
This article was last updated2011 days ago, the content may be outdated.


OK, 文件没有损坏,可以继续下一步了。


OK, the file is not corrupted, so you can proceed to the next step.
CertUtil [Options] -hashfile InFile [HashAlgorithm]
例如:
For example:
1 | certutil -hashfile filename sha1 |
其中 filename 是待校验的文件全名(带扩展名)
where filename is the full name (with extension) of the file to be verified
用处
Hash 是一种单向加密算法,其中最常用的算法包括 MD5 和 SHA1.
所谓单向加密就是只能加密不能解密。这有什么用嘞?
用处就是可以用来验证两个文件是不是完全相同。由于 Hash 算法的性质是对于两个不同的文件(哪怕只有一个字节不同)是一定不会得到相同的 Hash 校验码的,所以在利用网络传输文件前,我们可以先计算该文件的 Hash 校验码,在对方收到该文件后,也可以使用相同的 Hash 算法计算该文件的检验码,如果相同,则说明这次网络传输没有造成文件的损坏。
要知道,利用网盘(百度网盘)在传输文件时是很有可能造成文件损坏的。
文章封面的图是我在 MSDN 上下载的 Windows 10 系统镜像,可以看到下载下来的文件 SHA1 校验码和原文件完全相同,可以放心进行下一步的系统安装啦。
What It’s For
Hash is a one-way encryption algorithm, and the most commonly used algorithms include MD5 and SHA1.
So-called one-way encryption means it can only encrypt but not decrypt. So what’s the use of this?
The use is to verify whether two files are exactly identical. Because of the nature of the Hash algorithm, two different files (even if only one byte differs) will never produce the same Hash checksum. So before transferring a file over the network, we can first compute the file’s Hash checksum; after the other party receives the file, they can use the same Hash algorithm to compute its checksum. If the two match, it means the network transfer did not corrupt the file.
You should know that transferring files via cloud drives (Baidu Netdisk) is very likely to cause file corruption.
The cover image of this article is a Windows 10 system image I downloaded from MSDN. You can see that the SHA1 checksum of the downloaded file is exactly the same as the original file, so you can safely proceed with the system installation.



