SHA-256 哈希 / SHA-256 Hash Generator
功能介绍(中文)
SHA-256 是安全哈希算法(SHA-2 家族)的一种,能把任意长度的输入计算出固定 256 位(64 个十六进制字符)的摘要。它被广泛用于数字签名、证书、区块链和数据完整性校验。
本工具在浏览器本地调用 crypto.subtle 计算摘要;在局域网 HTTP 等非安全上下文中,会自动切换到内置的 JavaScript 实现,保证功能始终可用。哈希是单向的,无法从摘要反推出原文。
Overview (English)
SHA-256 is a member of the SHA-2 family that maps arbitrary input to a fixed 256-bit (64 hex character) digest. It is widely used in digital signatures, certificates, blockchains and integrity checks.
This tool computes the digest locally via crypto.subtle, with an automatic fallback to a built-in JavaScript implementation in non-secure contexts such as LAN HTTP. Hashing is one-way: the original text cannot be recovered from the digest.
功能特点(中文)
- 标准 64 位十六进制 SHA-256 输出
- 优先使用浏览器原生 crypto.subtle
- 非安全上下文自动使用 JS 降级实现
- 已用多组测试向量验证正确性
Features (English)
- Standard 64-character hexadecimal SHA-256 output
- Uses native crypto.subtle when available
- Automatic JS fallback in non-secure contexts
- Verified against multiple test vectors
常见问题 / FAQ
SHA-256 可以解密吗?
不可以。哈希是单向函数,只能从原文得到摘要,无法从摘要还原原文。这点和编码、加密都不同。
Can SHA-256 be reversed?
No. A hash is a one-way function: you can derive a digest from text but cannot recover the text from the digest. This differs from encoding and encryption.
SHA-256 哈希有什么用途?
常用于校验文件是否被篡改、生成内容签名、密码存储(应配合加盐和慢哈希)、区块链工作量证明等场景。
What is SHA-256 used for?
Common uses include detecting file tampering, generating content signatures, password storage (with salt and a slow KDF), and blockchain proof of work.