What is Hash function?
A hash function maps input data of any size to a fixed-size string of bytes (the hash or digest). The same input always produces the same output, small input changes produce very different outputs, and the process is one-way — you cannot reverse a hash back to its input.
Good cryptographic hashes are deterministic, one-way, and collision-resistant (it is infeasible to find two inputs with the same hash). Examples include MD5 and SHA-1 (now broken for security) and SHA-256 (the modern standard).
Hashes are used for file-integrity checks, digital signatures, deduplication and — with a salt and a slow KDF like bcrypt or argon2 — password storage.
Hash function tools
哈希生成器 — 全算法支持
在浏览器中直接计算文本或文件的 MD4、MD5、SHA-1、SHA-224、SHA-256、SHA-384、SHA-512、SHA3、Keccak-256、CRC-32 和 NTLM 哈希值。
打开工具SHA-256 哈希生成器
直接在浏览器中使用 Web Crypto API 计算文本或文件的 SHA-256 哈希值,支持导出十六进制或 Base64 格式的结果。
打开工具MD5 哈希生成器
在浏览器中直接计算文本或文件(最大 50 MB)的 MD5 哈希值,结果可导出为 Hex 或 Base64 格式。
打开工具SHA-1 哈希生成器
使用 Web Crypto API 在浏览器中直接计算文本或文件的 SHA-1 哈希值(摘要)。适用于 Git 提交哈希和一些旧版系统。
打开工具常见问题
SHA-1 现在还安全吗?
不安全——SHA-1 已经出现了实际可行的碰撞攻击(SHAttered,2017 年)。请不要将 SHA-1 用于数字签名或任何防篡改场景,建议改用 SHA-256。
为什么现在还有人在用 SHA-1?
主要是出于向后兼容的考虑——Git 用它来生成对象 ID(并配有碰撞检测补丁),一些较早的 TLS 系统以及历史遗留的文件校验也仍在使用它。
这个工具支持离线使用吗?
支持——页面加载完成后,哈希计算完全在你的浏览器本地进行。