yigityalim
projectshandbookslabshireshare
xgithub
siteprojectshandbookslabschangelog
aboutusesnowhireshare
elsewherexgithublinkedinemail
metarssllms.txtsitemap
© 2026 Yiğit Yalım. All rights reserved.
/
Back to Labs
May 10, 2026·crypto

SHA-2 Hash Lab

Live SHA-1, SHA-256, SHA-384 and SHA-512 in the browser. Watch the avalanche effect at bit level — change one character and roughly half the output bits flip.

sha-256 · sha-512 · hash · webcrypto

PreviousRegex TesterNextSorting Algorithm Visualizer

Hash functions exist for three properties: deterministic identity (same input → same output), fixed size (any input → same length output), avalanche (one-bit input change → ~50% of output bits flip).

This lab shows all three at once. Line A is fixed, line B is editable — change one character of B and watch the hash change completely, with the bar below counting the bit flips.

HashLab
A
43 B
—
B
44 B
—
avalanche
0/0 bit0.0%aynı

İdeal bir kriptografik hash'te tek karakterlik değişiklik bit'lerin ~%50'sini çevirir. A ve B girdileri aynı — hash'ler özdeş.

What it teaches

  • The same string always produces the same hash — hashes are stateless and deterministic
  • SHA-256 is always 256 bits (64 hex chars), SHA-512 is always 512 bits (128 hex chars) — input size never affects output size
  • A 1-bit change should produce ~50% bit flip — this is the avalanche criterion, the property that separates good hash functions from bad
  • Hashing is fast; an attacker can make trillions of guesses per second → never plain-hash a password, use a KDF

In practice

crypto.subtle.digest('SHA-256', encoded) — the browser's WebCrypto, also in Node 18+. No third-party library needed.

Don't use this for password hashing — you need Argon2id, scrypt, or at minimum PBKDF2-100k. Raw SHA-256 is for file checksums, content addressing, HMAC infrastructure, and similar.