main_ubi_sdk v 0.1.3
This is UBI4 documentation
CRC

Functions

uint8_t getCRC (uint8_t *data, uint32_t count)
 
uint32_t getCRC32 (uint8_t *data, uint32_t len)
 
void CRC32_Init (CRC32_Context *ctx)
 
void CRC32_Update (CRC32_Context *ctx, uint8_t *data, uint32_t len)
 
uint32_t CRC32_Final (CRC32_Context *ctx)
 

Variables

const uint8_t crc_table [256]
 
const uint32_t crc_table32 [256]
 CRC.
 

Detailed Description

Function Documentation

◆ CRC32_Final()

uint32_t CRC32_Final ( CRC32_Context * ctx)

◆ CRC32_Init()

void CRC32_Init ( CRC32_Context * ctx)

◆ CRC32_Update()

void CRC32_Update ( CRC32_Context * ctx,
uint8_t * data,
uint32_t len )

◆ getCRC()

uint8_t getCRC ( uint8_t * data,
uint32_t count )
Here is the caller graph for this function:

◆ getCRC32()

uint32_t getCRC32 ( uint8_t * data,
uint32_t len )
Here is the caller graph for this function:

Variable Documentation

◆ crc_table

const uint8_t crc_table[256]
Initial value:
= {
0, 94,188,226, 97, 63,221,131,194,156,126, 32,163,253, 31, 65,
157,195, 33,127,252,162, 64, 30, 95, 1,227,189, 62, 96,130,220,
35,125,159,193, 66, 28,254,160,225,191, 93, 3,128,222, 60, 98,
190,224, 2, 92,223,129, 99, 61,124, 34,192,158, 29, 67,161,255,
70, 24,250,164, 39,121,155,197,132,218, 56,102,229,187, 89, 7,
219,133,103, 57,186,228, 6, 88, 25, 71,165,251,120, 38,196,154,
101, 59,217,135, 4, 90,184,230,167,249, 27, 69,198,152,122, 36,
248,166, 68, 26,153,199, 37,123, 58,100,134,216, 91, 5,231,185,
140,210, 48,110,237,179, 81, 15, 78, 16,242,172, 47,113,147,205,
17, 79,173,243,112, 46,204,146,211,141,111, 49,178,236, 14, 80,
175,241, 19, 77,206,144,114, 44,109, 51,209,143, 12, 82,176,238,
50,108,142,208, 83, 13,239,177,240,174, 76, 18,145,207, 45,115,
202,148,118, 40,171,245, 23, 73, 8, 86,180,234,105, 55,213,139,
87, 9,235,181, 54,104,138,212,149,203, 41,119,244,170, 72, 22,
233,183, 85, 11,136,214, 52,106, 43,117,151,201, 74, 20,246,168,
116, 42,200,150, 21, 75,169,247,182,232, 10, 84,215,137,107, 53
}

◆ crc_table32

const uint32_t crc_table32[256]
Initial value:
=
{
0,
102971031, 96753217, 65495254, 34248685, 69837178, 130990508, 32372539, 68497370, 37099853, 30505371, 133320460, 102742071, 3968672, 64745078, 100194529,
27813083, 126571084, 74199706, 38732813, 61010742, 92390817, 107390327, 4559840, 96291585, 60718486, 7937344, 106572759, 129490156, 26536571, 41126573,
72399930, 55626166, 91488033, 110403575, 12036448, 22699611, 125397196, 77465626, 45956749, 122021484, 23515387, 42053677, 77760186, 89092481, 57427734,
9119680, 111677783, 49851757, 81501178, 121436972, 18861499, 15874688, 114363415, 87452865, 51731030, 116228791, 13546528, 53073142, 84599393, 82253146,
46408653, 19088155, 117470604, 111252332, 8562171, 57001261, 88535994, 78316673, 42480150, 24072896, 122446935, 45399222, 77040161, 124840695, 22273120,
12462939, 110960076, 91913498, 56183693, 118093751, 19579168, 47030774, 82745185, 84107354, 52451021, 13055515, 115605644, 52222061, 88076026, 114855468,
16496827, 18239360, 120944919, 80878017, 49360726, 99703514, 64121933, 3476635, 102119948, 133942583, 30997408, 37722998, 68988385, 31749376, 130499479,
69215041, 33756630, 65987309, 97375354, 103462060, 623163, 72957441, 41552022, 27093056, 129916631, 106146284, 7380859, 60293037, 95734074, 4985307,
107947852, 92817306, 61567245, 38176310, 73773217, 126013559, 27387616, 79764919, 48376608, 17124342, 119962977, 114002522, 15252685, 51371035, 86829708,
13906541, 116851962, 84960300, 53695163, 48145792, 83727127, 119206849, 20563286, 90798444, 55201787, 11349805, 109975994, 123989633, 21026838, 44546240,
75796055, 24925878, 123691041, 79167735, 43726432, 58114395, 89520076, 112367386, 9544077, 126997505, 28500630, 39158336, 74888407, 94061548, 62420347,
6231469, 108798778, 59046875, 94883148, 104902042, 6527757, 26111030, 128801441, 71973495, 40439008, 104444122, 1738317, 66971291, 98488332, 70461239,
34607520, 32993654, 131352545, 36478720, 68135319, 132696385, 30146518, 2492653, 101006970, 98721452, 63006779, 39882459, 71546956, 128243866, 25685517,
6953270, 105459617, 95309687, 59603424, 108372225, 5674902, 61994816, 93503959, 75445996, 39583867, 29057197, 127424058, 63498752, 99343511, 101497921,
3115734, 29523437, 132205434, 67513260, 35986747, 131974618, 33485645, 35230619, 70952204, 97997367, 66348192, 1246326, 103822049, 19941229, 118714874,
83104044, 47654843, 54186112, 85583383, 117343937, 14528598, 86337719, 50748960, 14761718, 113379425, 120586074, 17615309, 48998683, 80256908, 9970614,
112923937, 89945591, 58671968, 43168859, 78742220, 123134490, 24499341, 76352620, 44972795, 21584429, 124415162, 109550465, 10792214, 54775232, 90241879
}

CRC.

uint8_t result = 0;
while(count--) { result = crc_table[ (uint8_t) result ^ *data++]; }
return result;
return 0;
const uint8_t crc_table[256]
Definition data_verification.c:14
static uint8_t count
Definition while_sheduller.c:13