计算哈希值

前言

system example
Windows CertUtil -hashfile test.txt MD5
Windows CertUtil -hashfile test.txt SHA1
Linux md5sum test.txt
macOS md5 test.txt

Windows 计算哈希

CertUtil

1
2
3
4
5
6
7
8
PS C:\Users\htlsmile\Downloads> CertUtil -hashfile test.txt MD5
MD5 的 test.txt 哈希:
9f06243abcb89c70e0c331c61d871fa7
CertUtil: -hashfile 命令成功完成。
PS C:\Users\htlsmile\Downloads> CertUtil -hashfile test.txt SHA1
SHA1 的 test.txt 哈希:
fde773a18bb29f5ed65e6f0a7aa717fd1fa485d4
CertUtil: -hashfile 命令成功完成。
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
CertUtil -hashfile -?
用法:
CertUtil [选项] -hashfile InFile [HashAlgorithm]
通过文件生成并显示加密哈希

选项:
-Unicode -- 以 Unicode 编写重定向输出
-gmt -- 将时间显示为 GMT
-seconds -- 用秒和毫秒显示时间
-v -- 详细操作
-privatekey -- 显示密码和私钥数据
-pin PIN -- 智能卡 PIN
-sid WELL_KNOWN_SID_TYPE -- 数字 SID
22 -- 本地系统
23 -- 本地服务
24 -- 网络服务

哈希算法: MD2 MD4 MD5 SHA1 SHA256 SHA384 SHA512

Linux 计算哈希

md5sum

1
2
htlsmile@DESKTOP-SOIUA64:~$ md5sum test.txt
d8e8fca2dc0f896fd7cb4cb0031ba249 test.txt

macOS 计算哈希

1
2
> md5 test.txt
MD5 (test.txt) = d8e8fca2dc0f896fd7cb4cb0031ba249

后记

图方便就下软件
https://keir.net/hash.html

下载 Hash 1.04