# CheckSum Class Reference

`#include <CheckSum.h>`

List of all members.

## Public Member Functions

| CheckSum ()
void | clear ()
void | add (unsigned long w)
void | add (unsigned int w)
void | add (unsigned short w)
void | add (unsigned char *b, unsigned int length)
void | add (unsigned char b)
unsigned long | get ()

## Protected Attributes

unsigned short | r
unsigned short | c1
unsigned short | c2
unsigned long | sum

## Detailed Description

This class provide checksuming service.

## Constructor & Destructor Documentation

CheckSum::CheckSum | ( |  | ) | `[inline]`

| Default constructor

## Member Function Documentation

void CheckSum::add | ( | unsigned char | b | ) |

Add one byte of data for checksuming

Parameters:

  | b | a byte of data.

void CheckSum::add | ( | unsigned char * | b,
|  | unsigned int | length
| ) |

add an array of byte to the checksum.

Parameters:

  | b | a pointer to the buffer.
  | length | the size of the buffer.

void CheckSum::add | ( | unsigned short | w | ) |

add data to the checksum

Parameters:

  | w | a word of data.

void CheckSum::add | ( | unsigned int | w | ) | `[inline]`

add data to the checksum

Parameters:

  | w | add a dword of data.

void CheckSum::add | ( | unsigned long | w | ) |

add data to the checksum

Parameters:

  | w | add a dword of data

void CheckSum::clear | ( |  | ) | `[inline]`

| Reset to an initial state.

unsigned long CheckSum::get | ( |  | ) | `[inline]`

| Get the checksum of the data.

## Member Data Documentation

unsigned short CheckSum::c1 `[protected]`

unsigned short CheckSum::c2 `[protected]`

unsigned short CheckSum::r `[protected]`

unsigned long CheckSum::sum `[protected]`

The documentation for this class was generated from the following files:

- Projects/raknet/include/raknet/CheckSum.h
- Projects/raknet/Source/CheckSum.cpp