Logo Search packages:      
Sourcecode: djvulibre version File versions  Download package

DJVUAPI unsigned int hash ( const GBaseString ref  )  [friend, inherited]

Returns an integer. Implements a functional i18n atoi. Note that if you pass a GBaseString that is not in Native format the results may be disparaging. Returns a hash code for the string. This hashing function helps when creating associative maps with string keys (see {GMap}). This hash code may be reduced to an arbitrary range by computing its remainder modulo the upper bound of the range.

Definition at line 1792 of file GString.cpp.

  unsigned int x = 0;
  const char *s = (const char*)str;
  while (*s) 
    x = x ^ (x<<6) ^ (unsigned char)(*s++);
  return x;

Generated by  Doxygen 1.6.0   Back to index