Coconut Framework  beta
Functions
CNStrUtil.h File Reference

Define utility functions to operate string. More...

#include <stdint.h>
#include <string.h>

Go to the source code of this file.

Functions

static size_t CNLengthOfUTF8String (const unsigned char *src)
 Get length of UTF8String. More...
 
uint64_t CNCalcHashValueForString (size_t len, const unsigned char *str)
 Calculate hash value for string. More...
 
static unsigned int CNHashValueToIndex (uint64_t hashval, unsigned int maxnum)
 Get index value from hash value. More...
 

Detailed Description

Define utility functions to operate string.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

static size_t CNLengthOfUTF8String ( const unsigned char *  src)
inlinestatic

Get length of UTF8String.

Returns
Length of string
Parameters
srcSource string
uint64_t CNCalcHashValueForString ( size_t  len,
const unsigned char *  str 
)

Calculate hash value for string.

Returns
Hash value of string
Parameters
lenLength of source string
strSource string
static unsigned int CNHashValueToIndex ( uint64_t  hashval,
unsigned int  maxnum 
)
inlinestatic

Get index value from hash value.

Returns
Index value
Parameters
hashvalSource hash value
maxnumMax size for the index