仕組み
SHA-256 belongs to the SHA-2 family designed by the NSA and published by NIST in 2001. It pads the input, splits it into 512-bit blocks and runs 64 rounds of a compression function built from bitwise rotations, modular addition and a fixed set of round constants derived from the cube roots of the first 64 primes. The result is a 256-bit digest — 64 hexadecimal characters — with the avalanche property that flipping one input bit changes roughly half the output bits.
MD5 and CRC32 are included for compatibility, not for security. MD5 produces a 128-bit digest and has been collision-broken since 2004; CRC32 is a 32-bit cyclic redundancy check designed purely to detect transmission errors. Both remain in active use for S3 ETags, ZIP entries, PNG chunks, cache-busting filenames and legacy API signatures, which is why they are still worth having in a toolbox. HMAC-SHA256 instead wraps SHA-256 with a secret key, so the digest proves both integrity and possession of the key — the mechanism behind AWS SigV4, Stripe webhooks and JWT HS256 tokens.
Everything here executes locally through the Web Crypto API, plus compact JavaScript implementations of MD5 and CRC32 that the browser does not provide natively. The file path uses File.slice() to read the file in 4 MB chunks, feeding each one into a streaming hasher, so memory use stays flat regardless of file size. No part of the input is ever transmitted — you can verify this by opening your browser's network panel while the digest is computed.
主な利用シーン
- Verify a downloaded ISO or release archive against the checksum published by the vendor.
- Generate an S3-style ETag or Content-MD5 header for an object upload.
- Produce an HMAC-SHA256 signature to debug a webhook verification failure.
- Create a cache-busting fingerprint for a static asset filename.
- Check whether two large files are byte-identical without diffing them.
- Compute the CRC32 of an asset when building a ZIP or PNG chunk by hand.
最終更新: 2026-10-14 — 本文は英語で表示されます(UI は翻訳済み)。