跳到正文

STEMSTUDIO

Check a file is the real one

Files · computed on this device

Check a file is the real one

Drop a file and its hash is computed straight away. Paste the published value to see whether it matches.

  • Free, no account
  • Files are not uploaded

Help

Case, surrounding whitespace, separating colons and a trailing filename are all ignored. The algorithm is identified by length (8 = CRC32, 32 = MD5, 40 = SHA-1, 64 = SHA-256, 96 = SHA-384, 128 = SHA-512). MD5 and SHA-1 have demonstrated collisions: two different files can be made to produce the same value. They still work for "is this the same file the publisher shipped", but they cannot detect deliberate tampering. If the choice is yours, use SHA-256. CRC32 is an error-detecting checksum, not a hash — it is the same value ZIP files carry internally. It catches accidental corruption in transit and nothing more. Browsers normalise every line break in a text box to LF, so this will not match a file saved with CRLF line endings. To check a file, switch to the file mode above.

Processing, communication and stored data

为文件或文本计算 SHA-256、SHA-512、SHA-384、SHA-1、MD5 和 CRC32,并与公布的值比较。全部在浏览器中运行——什么都不会上传。

常见问题

我的文件会被上传吗?

不会。读取和计算都在浏览器中进行。关闭标签页后什么都不会留下。

能处理多大的文件?

SHA 算法通过浏览器的哈希 API 需要把整个文件放进内存;大约 500MB 以上的文件在某些设备上可能失败。只算 MD5/CRC32 时会按 2MB 分片读取。计算留在你的设备上,通常在独立于界面的 worker 中运行。

值和发布方的不一致,但本该一致

只要一个字节不同,结果就完全不同,所以先确认粘贴的值是完整的。另外请对下载下来的原样文件计算——用编辑器打开再保存,可能会改变换行或文字编码,哈希也就变了。

能用这个保存密码吗?

不能。SHA-256 之类的哈希是为快速而设计的,这对保存密码来说是错误的特性。请使用带盐和可调成本的专用方案,例如 bcrypt、scrypt 或 Argon2。

为什么文本框和文件得到的值不同?

浏览器会把文本框里的所有换行统一成 LF。以 CRLF 换行保存的文件确实是不同的数据,所以哈希不同。检查文件请用文件模式。

应该怎样验证下载?

记下发布方公布的值,在这里计算下载文件的哈希,比较两者。⚠️ 因为值和文件来自同一个地方,控制了那个地方的攻击者可以同时替换两者。验证能防止传输中的损坏和来自别处的副本——但不能防止发布方本身被攻破。

比较开头和结尾几个字符够吗?

要发现意外损坏,够了。针对故意篡改,不够:攻击者可以瞄准两端看起来一致的值。威胁是篡改时,请比较每一位——从这里复制值,用文本对比。

能对整个文件夹计算哈希吗?

不能。哈希把一个字节序列映射成一个值,没有公认的方法把多个文件合成一个。要检查文件夹,先打包再对压缩包计算——但要记住压缩包会嵌入时间戳,用相同内容重新打包会得到不同的值。

Ratings from users

Ratings appear once there are 10.

Report a problem or suggest something

The tool name, this page’s path and your browser type are sent with it. Files are never sent. For a reply, use the email on the Contact page.