FACT++  1.0
unsigned int calculateChecksum ( unsigned char *  buffer,
int  size 
)

Definition at line 2372 of file feeserver.c.

References size.

Referenced by add_item_node(), checkCommand(), checkIntLocation(), checkLocation(), and command_handler().

2372  {
2373  int n;
2374  unsigned int checks = 0;
2375  unsigned long adler = 1L;
2376  unsigned long part1 = adler & 0xffff;
2377  unsigned long part2 = (adler >> 16) & 0xffff;
2378 
2379  // calculates the checksum with the Adler32 algorithm
2380  for (n = 0; n < size; n++) {
2381  part1 = (part1 + buffer[n]) % ADLER_BASE;
2382  part2 = (part2 + part1) % ADLER_BASE;
2383  }
2384  checks = (unsigned int) ((part2 << 16) + part1);
2385 
2386  return checks;
2387 }
int buffer[BUFFSIZE]
Definition: db_dim_client.c:14
int size
Definition: db_dim_server.c:17

+ Here is the caller graph for this function: