Calculating a checksum
Add all the byte values in the block, then keep the remainder after dividing by 256 so the result fits in one byte. Example: 200+100+50=350, 350 mod 256 = 94.
Understanding Calculating a checksum in IGCSE Computer Science Paper 1
What it does: Adding the four byte values gives a total of 100, which is the first step before any reducing. MOD 256 discards the part of the total that does not fit in 8 bits, leaving a one-byte checksum. One byte holds 256 different values (0 to 255), so we take the remainder after dividing by 256. 200 + 100 + 50 = 350. 350 is too big for one byte, so 350 - 256 = 94. 10 + 20 + 30 + 40 = 100. This is already below 256, so it stays as 100. 255 + 1 = 256, and 256 mod 256 = 0. 256 cannot be stored in one byte.
Common mistakes: len(data) only counts how many bytes there are (3). A checksum needs the sum of the byte values, so it should be total = sum(data). A checksum is found by adding the bytes, not multiplying them. It should be total = a + b.
Free printable worksheet with full answer key — or add this module to a class and your students practise it interactively.
This module's key terms are also in a printable crossword (Modules 168–178) and word search (Modules 168–188).
Take this worksheet further — free with Cloodit
Each concept is reinforced from every angle — learned, then applied, then tested.
Cloodit turns curriculum-aligned coding content into journeys students work through one biome at a time.
Over 100 of them, across seven natural biomes.
Turns their work into revision material ready for Flash Cards and Exam study.
Live, competitive practice for the start of the lesson or a teacher-led lesson finisher.
Honour your top performers, or encourage a student who's trying hard — ready to print in seconds.
Quick Questions
Match the Pairs
Key Term
checksum = sum(bytes) % 256Fill in the Blanks
Spot the Error
Student with a class code? Join your class →