networking · beginner · ~15 min
Compute a one-byte XOR check.
Implement unsigned char xor_checksum(const unsigned char *data, int n) returning the XOR of all n bytes (a simple parity/BCC check).
unsigned char xor_checksum(const unsigned char *data, int n) {
/* TODO */
return 0;
}
Solve this exercise in the browser editor — compile and run against the test harness, no setup required.