FireSync API
 All Classes Files Functions Variables Typedefs Friends Macros Modules Pages
kCrc32.h
Go to the documentation of this file.
1 
8 #ifndef K_FIRESYNC_CRC32_H
9 #define K_FIRESYNC_CRC32_H
10 
11 #include <kFireSync/kFsDef.h>
12 
13 kBeginHeader()
14 
15 
16 #define kCRC32_POLYNOMIAL_NORMAL (0x04C11DB7)
17 
25 //typedef kObject kCrc32; --forward-declared in kFsDef.x.h
26 
33 typedef struct kCrc32Item
34 {
35  k32u remainder;
36 } kCrc32Item;
37 
44 kFsFx(kCrc32) kCrc32_Normal();
45 
55 kFsFx(kStatus) kCrc32_Construct(kCrc32* crc, k32u polynomial, kAlloc allocator);
56 
65 kFsFx(kStatus) kCrc32_Begin(kCrc32 crc, kCrc32Item* item);
66 
77 kFsFx(kStatus) kCrc32_Update(kCrc32 crc, kCrc32Item* item, const void* data, kSize size);
78 
87 kFsFx(k32u) kCrc32_Result(kCrc32 crc, const kCrc32Item* item);
88 
101 kFsFx(kStatus) kCrc32_Calculate(kCrc32 crc, const void* data, kSize size, k32u* result);
102 
103 kEndHeader()
104 
105 #include <kFireSync/Data/kCrc32.x.h>
106 
107 #endif
Implements a CRC-32 generator.
kStatus kCrc32_Construct(kCrc32 *crc, k32u polynomial, kAlloc allocator)
Constructs a kCrc32 object.
kStatus kCrc32_Calculate(kCrc32 crc, const void *data, kSize size, k32u *result)
Performs a CRC-32 calculation over the given data.
kCrc32 kCrc32_Normal()
Returns a kCrc32 object initialized with polynomial kCRC32_POLYNOMIAL_NORMAL.
kStatus kCrc32_Begin(kCrc32 crc, kCrc32Item *item)
Begins a streaming CRC calculation.
Essential API declarations for the kFireSync library.
k32u kCrc32_Result(kCrc32 crc, const kCrc32Item *item)
Calculates current result of a streaming CRC calculation.
kStatus kCrc32_Update(kCrc32 crc, kCrc32Item *item, const void *data, kSize size)
Updates a streaming CRC calculation.
Represents the state of an ongoing CRC-32 calculation.
Definition: kCrc32.h:33