tesseract  3.03
StringHash Struct Reference

#include <util.h>

List of all members.

Public Member Functions

size_t operator() (const string &s) const

Detailed Description

Definition at line 35 of file util.h.


Member Function Documentation

size_t StringHash::operator() ( const string &  s) const [inline]

Definition at line 36 of file util.h.

                                           {
    size_t hash_code = 0;
    const char* str = s.c_str();
    for (int ch = 0; str[ch] != 0; ++ch) {
      hash_code += str[ch] << (ch % 24);
    }
    return hash_code;
  }

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines