|
|
| version 1.2.2.1, 2010/06/13 16:10:16 | version 1.3.2.2, 2010/09/28 08:40:53 |
|---|---|
| Line 32 inline int crc_GetErrno(); | Line 32 inline int crc_GetErrno(); |
| inline const char *crc_GetError(); | inline const char *crc_GetError(); |
| // ------------------------------------------------------- | // ------------------------------------------------------- |
| /* | /* |
| * crcReflect() Reflect all bits of number | * crcReflect() Reflect all bits of number |
| * @crcNum = Number for reflection | * @crcNum = Number for reflection |
| Line 89 inline u_int crcAdler(u_char * __restrict psBuf, int b | Line 90 inline u_int crcAdler(u_char * __restrict psBuf, int b |
| */ | */ |
| #define crcEther(psBuf, bufLen) crcCalc((psBuf), (bufLen), 32, 3, 0xFFFFFFFF, 0xFFFFFFFF) | #define crcEther(psBuf, bufLen) crcCalc((psBuf), (bufLen), 32, 3, 0xFFFFFFFF, 0xFFFFFFFF) |
| /* | /* |
| * crcPelco() Calculate Pelco D/P CRC | * crcPelco() Calculate Pelco D/P CRC |
| * @ver = Pelco protocol version (Dd | Pp) | * @ver = Pelco protocol version (Dd | Pp) |
| Line 97 inline u_int crcAdler(u_char * __restrict psBuf, int b | Line 99 inline u_int crcAdler(u_char * __restrict psBuf, int b |
| Pelco protocol not supported | Pelco protocol not supported |
| */ | */ |
| inline u_char crcPelco(u_char ver, u_char *pkt); | inline u_char crcPelco(u_char ver, u_char *pkt); |
| /* | |
| * hash_varchar() Compute index hash by variable length string | |
| * @csStr = Input data buffer | |
| * @nStrLen = Length of data buffer | |
| * @nVer = Version of algorythm; 0 - original, 1 - AITNET variant | |
| * return: Hash value | |
| */ | |
| inline u_int hash_varchar(const char *csStr, int nStrLen, int nVer); | |
| /* | |
| * hash_bernstein() Compute index hash by Bernstein | |
| * @csStr = Input data buffer | |
| * @nStrLen = Length of data buffer | |
| * @nVer = Version of algorythm; 0 - Bernstein, 1 - DJBX33A variant | |
| * return: Hash value | |
| */ | |
| inline u_int hash_bernstein(const char *csStr, int nStrLen, int nVer); | |
| /* | |
| * hash_jenkins() Compute index hash by Jenkins (one-at-a-time) | |
| * @csStr = Input data buffer | |
| * @nStrLen = Length of data buffer | |
| * return: Hash value | |
| */ | |
| inline u_int hash_jenkins(const char *csStr, int nStrLen); | |
| /* | |
| * hash_reddragon() Compute index hash by Red Dragon | |
| * @csStr = Input data buffer | |
| * @nStrLen = Length of data buffer | |
| * return: Hash value | |
| */ | |
| inline u_int hash_reddragon(const char *csStr, int nStrLen); | |
| /* | |
| * hash_fnv1() Compute index hash by FNV-1 | |
| * @csStr = Input data buffer | |
| * @nStrLen = Length of data buffer | |
| * @nVer = Version of algorythm; 0 - FNV-1, 1 - FNV-1a (best avalanche) | |
| * return: Hash value | |
| */ | |
| inline u_int hash_fnv1(const char *csStr, int nStrLen, int nVer); | |
| /* | |
| * hash_fnv() Compute index hash by FNV-1a | |
| * @csStr = Input data buffer | |
| * @nStrLen = Length of data buffer | |
| * return: Hash value | |
| */ | |
| #define hash_fnv(str, len) hash_fnv1((str), (len), 1) | |
| #endif | #endif |