Define utility functions to operate string.
More...
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
Define utility functions to operate string.
- Copyright
- Copyright (C) 2012 Steel Wheels Project
static size_t CNLengthOfUTF8String |
( |
const unsigned char * |
src | ) |
|
|
inlinestatic |
Get length of UTF8String.
- Returns
- Length of string
- Parameters
-
uint64_t CNCalcHashValueForString |
( |
size_t |
len, |
|
|
const unsigned char * |
str |
|
) |
| |
Calculate hash value for string.
- Returns
- Hash value of string
- Parameters
-
len | Length of source string |
str | Source string |
static unsigned int CNHashValueToIndex |
( |
uint64_t |
hashval, |
|
|
unsigned int |
maxnum |
|
) |
| |
|
inlinestatic |
Get index value from hash value.
- Returns
- Index value
- Parameters
-
hashval | Source hash value |
maxnum | Max size for the index |