SNAP Library 2.1, User Reference  2013-09-25 10:47:25
SNAP, a general purpose, high performance system for analysis and manipulation of large networks
 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 1145 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 1147 of file hash.h.

                                                                        {
    unsigned int hash = 5381;
    for(unsigned int i = 0; i < Len; Str++, i++) {
       hash = ((hash << 5) + hash) + (*Str); }
    return hash;
  }
static int TStrHashF_DJB::GetPrimHashCd ( const char *  p) [inline, static]

Definition at line 1154 of file hash.h.

                                                 {
    const char *r = p;  while (*r) { r++; }
    return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }
static int TStrHashF_DJB::GetPrimHashCd ( const TStr s) [inline, static]

Definition at line 1160 of file hash.h.

{ return GetPrimHashCd(s.CStr()); }
static int TStrHashF_DJB::GetSecHashCd ( const char *  p) [inline, static]

Definition at line 1157 of file hash.h.

                                                {
    const char *r = p;  while (*r) { r++; }
    return (int) DJBHash((const char *) p, r - p) & 0x7fffffff; }
static int TStrHashF_DJB::GetSecHashCd ( const TStr s) [inline, static]

Definition at line 1161 of file hash.h.

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

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