Skip to content

Instantly share code, notes, and snippets.

@stilldavid
Created March 29, 2011 16:04
Show Gist options
  • Save stilldavid/892641 to your computer and use it in GitHub Desktop.
Save stilldavid/892641 to your computer and use it in GitHub Desktop.
uint8_t xor_checksum(char *string) {
size_t i;
uint8_t XOR;
uint8_t c;
XOR = 0;
// Calculate checksum ignoring the first two $s
for (i = 2; i < strlen(string); i++) {
c = string[i];
XOR ^= c;
}
return XOR;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment