SNAP Library, Developer Reference  2012-10-02 12:56:23
SNAP, a general purpose network analysis and graph mining library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
TStrHashF_DJB Class Reference

#include <hash.h>

List of all members.

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


Member Function Documentation

static unsigned int TStrHashF_DJB::DJBHash ( const char *  Str,
const ::TSize Len 
) [inline, static, private]

Definition at line 1142 of file hash.h.

References Len().

Referenced by GetPrimHashCd(), and GetSecHashCd().

                                                                        {
    unsigned int hash = 5381;
    for(unsigned int i = 0; i < Len; Str++, i++) {
       hash = ((hash << 5) + hash) + (*Str); }
    return hash;
  }

Here is the call graph for this function:

Here is the caller graph for this function:

static int TStrHashF_DJB::GetPrimHashCd ( const char *  p) [inline, static]

Definition at line 1149 of file hash.h.

References DJBHash().

                                                 {
    const char *r = p;  while (*r) { r++; }
    return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }

Here is the call graph for this function:

static int TStrHashF_DJB::GetPrimHashCd ( const TStr s) [inline, static]

Definition at line 1155 of file hash.h.

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

Referenced by GetPrimHashCd().

{ return GetPrimHashCd(s.CStr()); }

Here is the call graph for this function:

Here is the caller graph for this function:

static int TStrHashF_DJB::GetSecHashCd ( const char *  p) [inline, static]

Definition at line 1152 of file hash.h.

References DJBHash().

                                                {
    const char *r = p;  while (*r) { r++; }
    return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }

Here is the call graph for this function:

static int TStrHashF_DJB::GetSecHashCd ( const TStr s) [inline, static]

Definition at line 1156 of file hash.h.

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

Referenced by GetSecHashCd().

{ return GetSecHashCd(s.CStr()); }

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: