| 26 | static unsigned int g_crc_table[256u]; |
| 27 | |
| 28 | static void InitCRCTable() |
| 29 | { |
| 30 | unsigned int crc; |
| 31 | |
| 32 | for(unsigned int i= 0u; i < 256u; i++ ) |
| 33 | { |
| 34 | crc= i; |
| 35 | for(unsigned int j= 0u; j < 8u; j++ ) |
| 36 | crc= ( ( crc & 1u ) != 0u ) ? ( (crc>>1u) ^ 0xEDB88320u ) : ( crc >> 1u ); |
| 37 | |
| 38 | g_crc_table[i]= crc; |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | // TODO - init table at compile time. |
| 43 | static const bool g_crc_table_init= |