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-26 10:07

>>6
//echo $factor($base(2468ACF0,16,10))
[1, 610839792], [2, 305419896], [3, 203613264], [4, 152709948], [6, 101806632], [8, 76354974], [9, 67871088], [12, 50903316], [16, 38177487], [18, 33935544], [24, 25451658], [27, 22623696], [36, 16967772], [48, 12725829], [54, 11311848], [72, 8483886], [81, 7541232], [108, 5655924], [144, 4241943], [162, 3770616], [216, 2827962], [243, 2513744], [324, 1885308], [432, 1413981], [486, 1256872], [648, 942654], [972, 628436], [1296, 471327], [1944, 314218], [3888, 157109]

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