tesseract  4.00.00dev
StringHash Struct Reference

#include <util.h>

Public Member Functions

size_t operator() (const string &s) const
 

Detailed Description

Definition at line 35 of file util.h.

Member Function Documentation

◆ operator()()

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

Definition at line 36 of file util.h.

36  {
37  size_t hash_code = 0;
38  const char* str = s.c_str();
39  for (int ch = 0; str[ch] != 0; ++ch) {
40  hash_code += str[ch] << (ch % 24);
41  }
42  return hash_code;
43  }

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