Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

ye

Name: Anonymous 2010-09-25 22:03

sup /prog/

what do you think of my checksum algorithm?

int PrimeSum(char* buffer, int start, int size)
{
     int sum = 1;
     int prime = 0x2468ACF0;

     for (int i = start; i < (start + size); i++)
     {
          sum ^= ((sum << 8) | buffer[i]) * prime;
     }
    
     return sum;
}

Name: Anonymous 2010-09-25 22:26

>>2
oops... meant to type 0x0x2468ACF9

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List