SNAP Library 4.0, Developer Reference  2017-07-27 13:18:06
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 int GetPrimHashCd (const char *p, const ::TSize &Len)
 
static int GetSecHashCd (const char *p, const ::TSize &Len)
 

Static Private Member Functions

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

Detailed Description

Definition at line 1244 of file hash.h.

Member Function Documentation

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

Definition at line 1246 of file hash.h.

Referenced by GetPrimHashCd(), and GetSecHashCd().

1246  {
1247  unsigned int hash = 5381;
1248  for(unsigned int i = 0; i < Len; Str++, i++) {
1249  hash = ((hash << 5) + hash) + (*Str); }
1250  return hash;
1251  }

Here is the caller graph for this function:

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

Definition at line 1253 of file hash.h.

References DJBHash().

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

1253  {
1254  const char *r = p; while (*r) { r++; }
1255  return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }
static unsigned int DJBHash(const char *Str, const ::TSize &Len)
Definition: hash.h:1246

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 1259 of file hash.h.

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

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

Here is the call graph for this function:

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

Definition at line 1263 of file hash.h.

References DJBHash().

1263  {
1264  return (int) DJBHash((const char *) p, Len) & 0x7fffffff; }
static unsigned int DJBHash(const char *Str, const ::TSize &Len)
Definition: hash.h:1246

Here is the call graph for this function:

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

Definition at line 1256 of file hash.h.

References DJBHash().

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

1256  {
1257  const char *r = p; while (*r) { r++; }
1258  return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }
static unsigned int DJBHash(const char *Str, const ::TSize &Len)
Definition: hash.h:1246

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 1261 of file hash.h.

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

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

Here is the call graph for this function:

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

Definition at line 1265 of file hash.h.

References DJBHash().

1265  {
1266  return (int) DJBHash((const char *) p, Len) & 0x7fffffff; }
static unsigned int DJBHash(const char *Str, const ::TSize &Len)
Definition: hash.h:1246

Here is the call graph for this function:


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