SNAP Library 2.4, Developer Reference  2015-05-11 19:40:56
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TStrHashF_DJB Class Reference

#include <hash.h>

Static Public Member Functions

static int GetPrimHashCd (const char *p)
 
static int GetSecHashCd (const char *p)
 
static int GetPrimHashCd (const TStr &s)
 
static int GetSecHashCd (const TStr &s)
 

Static Private Member Functions

static unsigned int DJBHash (const char *Str, const ::TSize &Len)
 

Detailed Description

Definition at line 1146 of file hash.h.

Member Function Documentation

static unsigned int TStrHashF_DJB::DJBHash ( const char *  Str,
const ::TSize Len 
)
inlinestaticprivate

Definition at line 1148 of file hash.h.

Referenced by GetPrimHashCd(), and GetSecHashCd().

1148  {
1149  unsigned int hash = 5381;
1150  for(unsigned int i = 0; i < Len; Str++, i++) {
1151  hash = ((hash << 5) + hash) + (*Str); }
1152  return hash;
1153  }

Here is the caller graph for this function:

static int TStrHashF_DJB::GetPrimHashCd ( const char *  p)
inlinestatic

Definition at line 1155 of file hash.h.

References DJBHash().

Referenced by TChA::GetPrimHashCd(), TRStr::GetPrimHashCd(), TBigStrPool::GetPrimHashCd(), and TStrPool::GetPrimHashCd().

1155  {
1156  const char *r = p; while (*r) { r++; }
1157  return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }
static unsigned int DJBHash(const char *Str, const ::TSize &Len)
Definition: hash.h:1148

Here is the call graph for this function:

Here is the caller graph for this function:

static int TStrHashF_DJB::GetPrimHashCd ( const TStr s)
inlinestatic

Definition at line 1161 of file hash.h.

References TStr::CStr(), and GetPrimHashCd().

Referenced by GetPrimHashCd().

1161 { return GetPrimHashCd(s.CStr()); }
char * CStr()
Definition: dt.h:476
static int GetPrimHashCd(const char *p)
Definition: hash.h:1155

Here is the call graph for this function:

Here is the caller graph for this function:

static int TStrHashF_DJB::GetSecHashCd ( const char *  p)
inlinestatic

Definition at line 1158 of file hash.h.

References DJBHash().

Referenced by TChA::GetSecHashCd(), TRStr::GetSecHashCd(), TBigStrPool::GetSecHashCd(), and TStrPool::GetSecHashCd().

1158  {
1159  const char *r = p; while (*r) { r++; }
1160  return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }
static unsigned int DJBHash(const char *Str, const ::TSize &Len)
Definition: hash.h:1148

Here is the call graph for this function:

Here is the caller graph for this function:

static int TStrHashF_DJB::GetSecHashCd ( const TStr s)
inlinestatic

Definition at line 1162 of file hash.h.

References TStr::CStr(), and GetSecHashCd().

Referenced by GetSecHashCd().

1162 { return GetSecHashCd(s.CStr()); }
static int GetSecHashCd(const char *p)
Definition: hash.h:1158
char * CStr()
Definition: dt.h:476

Here is the call graph for this function:

Here is the caller graph for this function:


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