Real World Maths Busters

The Maths Behind Everyday Life

The story, the formula and a worked example — see exactly where this maths shows up in the world around you.

Back to all stories
Technology 3 min read

How Computers Spot Corrupted Downloads

A checksum catches errors by summing all the bytes.

When you download a file, a checksum verifies nothing was corrupted in transit. It’s a single number computed from all the bytes — change one byte and the checksum changes.

Simple Checksum

The simplest checksum adds all bytes modulo 256. A file with bytes [72, 101, 108, 108, 111] ("Hello") sums to 500 mod 256 = 244.

Checksum=(∑ibi) mod 256\text{Checksum} = \left( \sum_{i} b_i \right) \bmod 256

Checksum of "Hello"

  1. 1

    Sum bytes

    72+101+108+108+111=50072 + 101 + 108 + 108 + 111 = 500
  2. 2

    Mod 256

    500 mod 256=244500 \bmod 256 = 244
Answer

Checksum = 244 — if the downloaded file gives a different sum, it’s corrupted

The takeaway

Checksums distill entire files into single numbers — any corruption changes the result.

Back to all stories