- Inherits from:
- Object
- Declared in:
- DCRC32.h
Object
|
+---DCRC32
Class Description
The CRC32 class implements a number of methods for calculating the CRC-32
checksum.
- Example:
#include <stdio.h>
#include "ofc/DCRC32.h"
int main(int argc, char *argv[])
{
DCRC32 *crc = [DCRC32 new];
[crc update :"This is an example for the CRC32 class"]; // Feed the CRC32 with a c-string
[crc update :"This is data\0With string terminator" :35]; // Feed the CRC32 with data
printf("CRC32 value: %lx.\n", [crc crc32]); // Get the CRC32 value
[crc free]; // Cleanup
return 0;
}
- Last modified:
- 26-Aug-2008 (DCRC32.h)
Instance Variables
- private uint32_t _crc32
- the crc32 value
- Constructors
- - (DCRC32 *) init
- Initialise to an empty object
- Returns:
- the instance
- - (DCRC32 *) init :(const char *) cstring
- Initialise the object with a c-string
- Parameters:
- cstring - the string
- Returns:
- the object
- - (DCRC32 *) init :(const unsigned char *) data :(unsigned long) length
- Initialise the object with data
- Parameters:
- data - the data ('\0' allowed)
length - the length of the data
- Returns:
- the object
- Update methods
- - (DCRC32 *) update :(const char *) cstring
- Update the object with a c-string. Repeated calls can be compared
to a single call in which the strings are concatted
- Parameters:
- cstring - the c-string to be feeded to crc32
- Returns:
- the object
- - (DCRC32 *) update :(const unsigned char *) data :(unsigned long) length
- Update the object with data. Repeated calls can be compared
to a single call in which the strings are concatted
- Parameters:
- data - the data to be feeded to md5
length - the length of the data
- Returns:
- the object
- Result methods
- - (unsigned long) crc32
- Return the (current) result of all data passed to the object.
- Returns:
- the crc32 value
generated 06-Sep-2008 by ObjcDoc 3.0.0