Code

From Twilight Princess Wiki
Jump to navigation Jump to search

Simple Checksum[edit | edit source]

A simple additive checksum algorithm used to validate Save Data

1 void CheckSum(char* buffer, int* sum, int* nsum) {
2     int len = sizeof(buffer);
3     
4     for(int i = 0; i < len; i++)
5     {
6         *sum += buffer[i];
7     }
8     *nsum = -(*sum + len);
9 }