What Is a Checksum
A checksum is a short value calculated from a block of data that acts as a fingerprint for it, used to detect whether the data has been accidentally changed or corrupted — you run the same calculation on the data again later, and if the two checksums match, the data is almost certainly intact; if they differ, something was altered. The problem it solves is that data is not always perfectly preserved. When a file is downloaded, copied across a network as the packets from the internet topic, or stored on a disk for years, a stray error can flip a bit — turn a 0 into a 1 — and corrupt it. The trouble is that corrupted data often looks fine at a glance, so you need a way to check integrity automatically. A checksum provides it: before sending or storing data, you compute a checksum from it using a fixed formula; afterward, you recompute it and compare. Because even a single changed bit produces a different checksum, a mismatch reliably flags that the data is no longer what it should be. This is why checksums are quietly everywhere. The packets the internet topic described each carry a checksum, so a receiving computer can detect a packet that arrived garbled and ask for it to be resent — a core reason the internet delivers data reliably over imperfect connections. Downloaded software is often published alongside a checksum so you can verify the file you received is complete and unmodified. And storage systems use checksums to notice when a file on disk has silently decayed. It is worth distinguishing a checksum's purpose from the hashing in the password-hash topic, since they use similar machinery. Both run data through a formula to produce a fixed-length value, but their goals differ: a simple checksum is designed only to catch accidental errors cheaply, whereas a cryptographic hash (the kind used for passwords and security) is built to also resist deliberate tampering, so that an attacker cannot craft different data with the same fingerprint. For catching random corruption, a lightweight checksum is enough; for proving data was not maliciously altered, a stronger cryptographic hash is required. The simple takeaway is that a checksum is a data fingerprint for spotting corruption: compute it before, recompute it after, and a mismatch means the data changed — which is how networks catch garbled packets, how you verify a download arrived intact, and how storage systems detect silent decay, all by comparing one short number.