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 
14 #define kCRC32_POLYNOMIAL_NORMAL (0x04C11DB7)
15 
23 //typedef kObject kCrc32; --forward-declared in kFsDef.x.h
24 
31 typedef struct kCrc32Item
32 {
33  k32u remainder;
34 } kCrc32Item;
35 
42 kFsFx(kCrc32) kCrc32_Normal();
43 
53 kFsFx(kStatus) kCrc32_Construct(kCrc32* crc, k32u polynomial, kAlloc allocator);
54 
63 kFsFx(kStatus) kCrc32_Begin(kCrc32 crc, kCrc32Item* item);
64 
75 kFsFx(kStatus) kCrc32_Update(kCrc32 crc, kCrc32Item* item, const void* data, kSize size);
76 
85 kFsFx(k32u) kCrc32_Result(kCrc32 crc, const kCrc32Item* item);
86 
99 kFsFx(kStatus) kCrc32_Calculate(kCrc32 crc, const void* data, kSize size, k32u* result);
100 
101 #include <kFireSync/Data/kCrc32.x.h>
102 
103 #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:31