#include <stdio.h>
#include "str.h"
#include "ut.h"
#include "crc.h"

Go to the source code of this file.
Defines | |
| #define | UPDC16(ch, crc) (crc_16_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8)) |
| #define | UPDC32(ch, crc) (crc_32_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8)) |
| #define | UPDCIT(ch, crc) (ccitt_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8)) |
Functions | |
| void | crc32_uint (str *source_string, unsigned int *hash_ret) |
| CRC32 value from source string. | |
| unsigned short | crcitt_string (char *s, int len) |
| Return CCITT value from string. | |
| void | crcitt_string_array (char *dst, str src[], int size) |
| CCITT value from array. | |
Variables | |
| unsigned short int | ccitt_tab [] |
| unsigned short int | crc_16_tab [] |
| unsigned long int | crc_32_tab [] |
Definition in file crc.c.
| #define UPDC16 | ( | ch, | |||
| crc | ) | (crc_16_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8)) |
| #define UPDC32 | ( | ch, | |||
| crc | ) | (crc_32_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8)) |
| #define UPDCIT | ( | ch, | |||
| crc | ) | (ccitt_tab[((crc) ^ (ch)) & 0xff] ^ ((crc) >> 8)) |
| void crc32_uint | ( | str * | source_string, | |
| unsigned int * | hash_ret | |||
| ) |
CRC32 value from source string.
| source_string | source string | |
| hash_ret | calulated CRC32 |
Definition at line 270 of file crc.c.
References crc_32_tab, hash, _str::len, len, and _str::s.
Referenced by hash_func().
| unsigned short crcitt_string | ( | char * | s, | |
| int | len | |||
| ) |
| void crcitt_string_array | ( | char * | dst, | |
| str | src[], | |||
| int | size | |||
| ) |
CCITT value from array.
| dst | destination | |
| src | source array | |
| size | array size |
Definition at line 233 of file crc.c.
References CRC16_LEN, int2reverse_hex(), _str::len, len, LM_CRIT, _str::s, and UPDCIT.
Referenced by calc_crc_suffix(), and generate_fromtag().
| unsigned short int crc_16_tab[] |
| unsigned long int crc_32_tab[] |
1.5.6