哈希生成器(SHA-256、SHA-512、CRC32)
在浏览器中计算任意文本的 SHA-1、SHA-256、SHA-384、SHA-512 摘要和 CRC32 校验和。不上传,不经服务器。
What a hash function does
A cryptographic hash turns any input — text, an image, a file — into a fixed-length digest. The same input always produces the same output, and even a one-character change produces a completely different digest.
SHA-256("hello") = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Hash vs checksum vs encryption
These three are constantly confused:
- Hash — one-way, fixed length, designed to resist collisions. Use for integrity and password storage.
- Checksum (CRC32) — much weaker, mainly for detecting accidental data corruption in file transfers. Not secure.
- Encryption — reversible with a key. Use when you need to read the data back.
Which algorithm should you use?
| Algorithm | Status | Recommendation |
|---|---|---|
| SHA-256 | Current | Use for integrity, signatures, and most new work |
| SHA-384 / SHA-512 | Current | Use when you need a longer digest |
| SHA-1 | Broken | Do not use for security; collision attacks are practical |
| MD5 | Broken | Never for security; only for legacy file checksums |
Important: never hash passwords with a fast hash
SHA-256 is designed to be fast, which is exactly wrong for passwords. Attackers with GPUs can try billions of SHA-256 hashes per second. For passwords, use a deliberately slow algorithm: bcrypt, scrypt, Argon2 or PBKDF2.
This tool exists for integrity checks, file fingerprints, cache keys and verifying downloads — not for password storage.
Related
Generate a strong password to hash in the first place with the password generator.
常见问题
Is my input uploaded anywhere?
No. The digest is computed in your browser with the Web Crypto API. Your text is never transmitted or stored.
Which algorithm should I use?
SHA-256 for general integrity checks, file fingerprints and cache keys. SHA-1 and MD5 are broken and should not be used for security.
Can I use this to hash a password?
No. SHA-256 is designed to be fast, which is exactly wrong for passwords. Use bcrypt, scrypt, Argon2 or PBKDF2 with a salt.
Why does the same input always give the same hash?
That is the point. A hash function is deterministic, which is what makes it useful for verifying integrity and comparing files.
Does it support hashing a file?
Not in this version. For large files, use the sha256sum command on Linux or Get-FileHash in PowerShell.