TPIE

2362a60
tpie::hash< const char * > Struct Template Reference

Default hashing function for C-style strings. More...

#include <tpie/hash.h>

Public Member Functions

size_t operator() (const char *s) const
 Calculate string hash. More...
 

Detailed Description

template<>
struct tpie::hash< const char * >

Default hashing function for C-style strings.

Definition at line 84 of file hash.h.

Member Function Documentation

size_t tpie::hash< const char * >::operator() ( const char *  s) const
inline

Calculate string hash.

Parameters
sString to hash.

Definition at line 89 of file hash.h.

89  {
90  uint32_t r = 1;
91  for(int i=0; s[i]; i++){
92  r = r*13+s[i]*7;
93  }
94  return r;
95  }

The documentation for this struct was generated from the following file: