tesseract  4.0.0-1-g2a2b
StringHash Struct Reference

#include <util.h>

Public Member Functions

size_t operator() (const std::string &s) const
 

Detailed Description

Definition at line 32 of file util.h.

Member Function Documentation

◆ operator()()

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

Definition at line 33 of file util.h.

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

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