Where SHA-256 is used
- Download checksums (sha256sum)
- HMAC-SHA256 webhook signatures (Stripe, GitHub, Slack)
- Bitcoin block hashing, Subresource Integrity, TLS certificates
Command line
sha256sum file.txt shasum -a 256 file.txt # macOS Get-FileHash file.txt # PowerShell (SHA-256 by default) echo -n "text" | sha256sum
In code
# Python
hashlib.sha256(b"text").hexdigest()
// Node.js
crypto.createHash('sha256').update('text').digest('hex')
// Browser
const buf = await crypto.subtle.digest('SHA-256', new TextEncoder().encode('text'))
[...new Uint8Array(buf)].map(b => b.toString(16).padStart(2, '0')).join('')Hashing is deterministic and one-way: the same bytes always give the same 256-bit value, and a one-character change scrambles it completely — try the avalanche demo.