在命令提示符下
Microsoft Windows 10 操作系统中内置了一个命令行工具,作为证书服务,即“CertUtil”。该命令行提供了一个开关“Hashfile”,因此可以生成一个哈希字符串。这里可以使用指定的算法,例如MD5:
certutil -hashfile <file> <algorithm>
certutil -hashfile myfile.zip MD5
在 Windows 上的命令提示符中生成 MD5 文件校验和
使用 PowerShell
PowerShell 中还有一个命令。
这是最有效和最简单的方法,因为它不包括任何类型的编码。如果使用 PowerShell 4.0,则命令行中存在 cmdlet。此 cmdlet 也称为“Get-FileHash”。多亏了这个命令行,可以很容易地生成一个哈希文件:
Get-FileHash -Path <file> -algorithm <name>
Get-FileHash -Path myfile.zip -algorithm MD5
在 Powershell 中使用 Get-FileHash
在命令提示符下
Microsoft Windows 10 操作系统中内置了一个命令行工具,作为证书服务,即“CertUtil”。该命令行提供了一个开关“Hashfile”,因此可以生成一个哈希字符串。这里可以使用指定的算法,例如MD5:
certutil -hashfile <file> <algorithm>
certutil -hashfile myfile.zip MD5
在 Windows 上的命令提示符中生成 MD5 文件校验和
使用 PowerShell
PowerShell 中还有一个命令。
这是最有效和最简单的方法,因为它不包括任何类型的编码。如果使用 PowerShell 4.0,则命令行中存在 cmdlet。此 cmdlet 也称为“Get-FileHash”。多亏了这个命令行,可以很容易地生成一个哈希文件:
Get-FileHash -Path <file> -algorithm <name>
Get-FileHash -Path myfile.zip -algorithm MD5
在 Powershell 中使用 Get-FileHash