How can your browser calculate two hashes from one file read?

A download page may ask for a SHA-256 or SHA-512 checksum—a fingerprint of the file. FluffyBench can calculate both while reading your file just once.

How one file stream feeds two checksum calculations

Imagine reading a long letter aloud while two people listen and take notes by different rules. You don't have to start over for the second listener. Both hear the same words as you go.

FluffyBench Hash Checksum does something similar: it reads your file in pieces and sends each piece to both SHA-256 and SHA-512. Those are two different recipes for making a file's fingerprint, called a checksum or digest.

One file stream supplies pieces in order to separate SHA-256 and SHA-512 calculations. Both produce fingerprints after the last piece.

One stream, two calculations

Application-level data flow: the same pieces feed two separate calculations. How we reviewed

Why does a file get both SHA-256 and SHA-512 checksums?

A download publisher may give you either kind of checksum. Having both ready means you can use whichever recipe the publisher names, without choosing it before you open the file.

Here's dahlia-close-up.jpg in FluffyBench Hash Checksum, with its two fingerprints. Compare a publisher's SHA-256 reference with SHA-256, or a SHA-512 reference with SHA-512.

Workspace excerpts showing dahlia-close-up.jpg, Checksums, Both are made in one read, and its complete SHA-256 and SHA-512 results.

One photo's two fingerprints

  1. Selected photo

    The selected file is dahlia-close-up.jpg.

  2. SHA-256

    The shorter fingerprint belongs to SHA-256.

  3. SHA-512

    The longer fingerprint belongs to SHA-512.

Workspace excerpts from the same photo: each checksum recipe has its own result. · Photo: Tj Holowaychuk, Unsplash License, via Unsplash.

Doing it in FluffyBench: check a downloaded file

Use FluffyBench Hash Checksum to compare your download with a trusted reference. The dahlia photo below makes the steps concrete.

  1. File tab and Choose file button in FluffyBench Hash Checksum.
    File tab and Choose file button in FluffyBench Hash Checksum.
    Step 1. Choose your downloaded file. FluffyBench starts calculating as soon as you select it; the file stays on your device.
    1. Use File for a download.
    2. Choose file opens your file picker.
  2. The selected checksum-dahlia.jpg photo and Change file button.
    The selected checksum-dahlia.jpg photo and Change file button.
    Step 2. Check that you've selected the right download.
    1. Check the filename against your download.
    2. Change file lets you replace a wrong selection.
  3. The dahlia photo's recorded SHA-256 reference in Expected checksum, with It matches below it.
    The dahlia photo's recorded SHA-256 reference in Expected checksum, with It matches below it.
    Step 3. Paste the checksum from a publisher you trust for that exact download. Its length picks SHA-256 or SHA-512 automatically. Here we're using the photo's independently calculated reference.
    1. Expected checksum takes the reference value.
    2. It matches means the complete values agree.
  4. The matching SHA-256 row highlighted beside the separate SHA-512 result and their Copy buttons.
    The matching SHA-256 row highlighted beside the separate SHA-512 result and their Copy buttons.
    Step 4. The matching algorithm's row is highlighted. If you need the fingerprint as text, use Copy beside its name.
    1. This highlighted SHA-256 value matches the reference.
    2. Copy SHA-256 copies the complete SHA-256 value.
    3. The SHA-512 row keeps its separate result.

A match means the file agrees with the reference. It doesn't identify the publisher or tell you whether the download is safe to open; our guide to checksums and digital signatures explains that distinction.

How long did both file checksums take on a desktop?

We timed generated files held in memory on a desktop. Each bar measures the wait from choosing a file until both checksums were ready.

Time until both checksums are ready: 1,250 ms

Chrome · 1.0 MB
15.2 ms
Firefox · 1.0 MB
15 ms
Chrome · 16.8 MB
146.4 ms
Firefox · 16.8 MB
163 ms
Chrome · 134.2 MB
880.3 ms
Firefox · 134.2 MB
1,212 ms
0 ms250 ms500 ms750 ms1,000 ms1,250 ms
  1. Chrome · 134.2 MB

    The largest input's Chrome result.

  2. Firefox · 134.2 MB

    The same input's Firefox result.

Each file-size pair shows the middle time for Chrome and Firefox.

Even the largest input, 134.2 MB, finished in under a second in Chrome and just over a second in Firefox on that desktop. You can use the result as soon as both checksum lines appear.

Search FluffyBench