Checksum
A checksum is a small-sized datum derived from an arbitrary block of digital data for the purpose of detecting errors that may have been introduced during its transmission or storage.
Algorithms: 1. Parity Byte. 2. Modular Sum. 3. CRC32 (Standard for Ethernet/ZIP). 4. Cryptographic (MD5, SHA-1, SHA-256). Applications: File verification (MD5sum), Network protocols (TCP/UDP), Blockchain addresses, System memory (ECC RAM).
graph LR
Center["Checksum"]:::main
classDef main fill:#7c3aed,stroke:#8b5cf6,stroke-width:2px,color:white,font-weight:bold,rx:5,ry:5;
classDef pre fill:#0f172a,stroke:#3b82f6,color:#94a3b8,rx:5,ry:5;
classDef child fill:#0f172a,stroke:#10b981,color:#94a3b8,rx:5,ry:5;
classDef related fill:#0f172a,stroke:#8b5cf6,stroke-dasharray: 5 5,color:#94a3b8,rx:5,ry:5;
linkStyle default stroke:#4b5563,stroke-width:2px;
🧒 Explain Like I'm 5
Imagine you are sending a box of 10 apples to a friend. To make sure none get lost or replaced with rocks during the trip, you write the number '10' on the outside of the box. When your friend gets it, they count the apples. If they counting 9, they know something went wrong. A checksum is that number '10' for computer files—it's a simple way to check if everything arrived exactly as it was sent.
🤓 Expert Deep Dive
Technically, the 'strength' of a checksum depends on its resistance to 'Collisions' (two different inputs producing the same checksum). While simple checksums like the 1s-complement sum used in IPv4 headers are fast but weak, Cyclic Redundancy Checks (CRC) are much better at detecting 'Burst Errors' (multiple bit-flips in a row). For high-security environments, 'Cryptographic Hash Functions' are used as checksums because they satisfy the 'Avalanche Effect' (changing one bit changes half the output bits) and are 'Pre-image Resistant'. In blockchain technology, checksums are often included in addresses (like Bech32 or EIP-55) to prevent users from accidentally sending funds to a mistyped address.