Binary Files · 13 / 14 Exercise Medium

Checksum of a file

Objective

To check that a file has not been corrupted, a checksum is computed by reading it in blocks, without loading it whole into memory.

Instructions

  • The file datos.bin exists. Read it in blocks of 4 bytes.
  • Show Bytes: total, CRC32: xxxxxxxx (CRC-32 with zlib.crc32 and 8 lowercase hexadecimal digits) and Sum: n (sum of all bytes modulo 256).
Output
Bytes: 11
CRC32: 0d4a1185
Sum: 92

Open the editor in full screen: the statement on the left and your code, the output and the tests on the right.

Start exercise