BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bdlb::HashUtil Struct Reference

#include <bdlb_hashutil.h>

Static Public Member Functions

static unsigned int hash0 (char key, int modulus)
 
static unsigned int hash0 (signed char key, int modulus)
 
static unsigned int hash0 (unsigned char key, int modulus)
 
static unsigned int hash0 (short key, int modulus)
 
static unsigned int hash0 (unsigned short key, int modulus)
 
static unsigned int hash0 (int key, int modulus)
 
static unsigned int hash0 (unsigned int key, int modulus)
 
static unsigned int hash0 (long key, int modulus)
 
static unsigned int hash0 (unsigned long key, int modulus)
 
static unsigned int hash0 (bsls::Types::Int64 key, int modulus)
 
static unsigned int hash0 (bsls::Types::Uint64 key, int modulus)
 
static unsigned int hash0 (float key, int modulus)
 
static unsigned int hash0 (double key, int modulus)
 
static unsigned int hash0 (const void *key, int modulus)
 
static unsigned int hash0 (const char *string, int modulus)
 
static unsigned int hash0 (const char *string, int stringLength, int modulus)
 
static unsigned int hash1 (const char *data, int length)
 
static unsigned int hash2 (const char *data, int length)
 
static unsigned int hash1 (char key)
 
static unsigned int hash1 (signed char key)
 
static unsigned int hash1 (unsigned char key)
 
static unsigned int hash1 (short key)
 
static unsigned int hash1 (unsigned short key)
 
static unsigned int hash1 (int key)
 
static unsigned int hash1 (unsigned int key)
 
static unsigned int hash1 (long key)
 
static unsigned int hash1 (unsigned long key)
 
static unsigned int hash1 (bsls::Types::Int64 key)
 
static unsigned int hash1 (bsls::Types::Uint64 key)
 
static unsigned int hash1 (float key)
 
static unsigned int hash1 (double key)
 
static unsigned int hash1 (const void *key)
 
static unsigned int hash2 (char key)
 
static unsigned int hash2 (signed char key)
 
static unsigned int hash2 (unsigned char key)
 
static unsigned int hash2 (short key)
 
static unsigned int hash2 (unsigned short key)
 
static unsigned int hash2 (int key)
 
static unsigned int hash2 (unsigned int key)
 
static unsigned int hash2 (long key)
 
static unsigned int hash2 (unsigned long key)
 
static unsigned int hash2 (bsls::Types::Int64 key)
 
static unsigned int hash2 (bsls::Types::Uint64 key)
 
static unsigned int hash2 (float key)
 
static unsigned int hash2 (double key)
 
static unsigned int hash2 (const void *key)
 

Member Function Documentation

◆ hash0() [1/16]

unsigned int bdlb::HashUtil::hash0 ( bsls::Types::Int64  key,
int  modulus 
)
inlinestatic

◆ hash0() [2/16]

unsigned int bdlb::HashUtil::hash0 ( bsls::Types::Uint64  key,
int  modulus 
)
inlinestatic

◆ hash0() [3/16]

unsigned int bdlb::HashUtil::hash0 ( char  key,
int  modulus 
)
inlinestatic

◆ hash0() [4/16]

static unsigned int bdlb::HashUtil::hash0 ( const char *  string,
int  modulus 
)
static

Return a pseudo-random unsigned integer in the range from zero to one less than the specified modulus corresponding to the specified null-terminated string. The behavior is undefined unless 0 < modulus < 2^31. Note that modulus is expected to be a prime not close to an integral power of 2. Also note that specifying a modulus of 1 will cause 0 to be returned for every string.

◆ hash0() [5/16]

static unsigned int bdlb::HashUtil::hash0 ( const char *  string,
int  stringLength,
int  modulus 
)
static

◆ hash0() [6/16]

unsigned int bdlb::HashUtil::hash0 ( const void *  key,
int  modulus 
)
inlinestatic

Return an unsigned integer hash value in the range from zero to one less than the specified modulus corresponding to the specified key. The behavior is undefined unless 0 < modulus < 2^31. Note that modulus is expected to be a prime not close to an integral power of 2. Also note that specifying a modulus of 1 will cause 0 to be returned for every value.

◆ hash0() [7/16]

unsigned int bdlb::HashUtil::hash0 ( double  key,
int  modulus 
)
inlinestatic

◆ hash0() [8/16]

unsigned int bdlb::HashUtil::hash0 ( float  key,
int  modulus 
)
inlinestatic

◆ hash0() [9/16]

unsigned int bdlb::HashUtil::hash0 ( int  key,
int  modulus 
)
inlinestatic

◆ hash0() [10/16]

unsigned int bdlb::HashUtil::hash0 ( long  key,
int  modulus 
)
inlinestatic

◆ hash0() [11/16]

unsigned int bdlb::HashUtil::hash0 ( short  key,
int  modulus 
)
inlinestatic

◆ hash0() [12/16]

unsigned int bdlb::HashUtil::hash0 ( signed char  key,
int  modulus 
)
inlinestatic

◆ hash0() [13/16]

unsigned int bdlb::HashUtil::hash0 ( unsigned char  key,
int  modulus 
)
inlinestatic

◆ hash0() [14/16]

unsigned int bdlb::HashUtil::hash0 ( unsigned int  key,
int  modulus 
)
inlinestatic

◆ hash0() [15/16]

unsigned int bdlb::HashUtil::hash0 ( unsigned long  key,
int  modulus 
)
inlinestatic

◆ hash0() [16/16]

unsigned int bdlb::HashUtil::hash0 ( unsigned short  key,
int  modulus 
)
inlinestatic

◆ hash1() [1/15]

static unsigned int bdlb::HashUtil::hash1 ( bsls::Types::Int64  key)
static

◆ hash1() [2/15]

static unsigned int bdlb::HashUtil::hash1 ( bsls::Types::Uint64  key)
static

◆ hash1() [3/15]

static unsigned int bdlb::HashUtil::hash1 ( char  key)
static

◆ hash1() [4/15]

static unsigned int bdlb::HashUtil::hash1 ( const char *  data,
int  length 
)
static

Return a pseudo-random unsigned integer in the range from zero to one less than the specified modulus corresponding to the specified string having the specified stringLength. string need not be null-terminated and may contain embedded null characters. The behavior is undefined unless 0 <= stringLength and 0 < modulus < 2^31. Note that modulus is expected to be a prime not close to an integral power of 2. Also note that specifying a modulus of 1 will cause 0 to be returned for every string.

◆ hash1() [5/15]

static unsigned int bdlb::HashUtil::hash1 ( const void *  key)
static

Return an unsigned integer hash value corresponding to the specified key. Note that the return value is seemingly random (i.e., the hash is good) but identical on all platforms (irrespective of endianness). Both functions hash1 and hash2 return a hash, but both hashes can be assumed to be independent (i.e., there are no known correlations between the results of both hash functions given the same input data).

◆ hash1() [6/15]

static unsigned int bdlb::HashUtil::hash1 ( double  key)
static

◆ hash1() [7/15]

static unsigned int bdlb::HashUtil::hash1 ( float  key)
static

◆ hash1() [8/15]

static unsigned int bdlb::HashUtil::hash1 ( int  key)
static

◆ hash1() [9/15]

static unsigned int bdlb::HashUtil::hash1 ( long  key)
static

◆ hash1() [10/15]

static unsigned int bdlb::HashUtil::hash1 ( short  key)
static

◆ hash1() [11/15]

static unsigned int bdlb::HashUtil::hash1 ( signed char  key)
static

◆ hash1() [12/15]

static unsigned int bdlb::HashUtil::hash1 ( unsigned char  key)
static

◆ hash1() [13/15]

static unsigned int bdlb::HashUtil::hash1 ( unsigned int  key)
static

◆ hash1() [14/15]

static unsigned int bdlb::HashUtil::hash1 ( unsigned long  key)
static

◆ hash1() [15/15]

static unsigned int bdlb::HashUtil::hash1 ( unsigned short  key)
static

◆ hash2() [1/15]

static unsigned int bdlb::HashUtil::hash2 ( bsls::Types::Int64  key)
static

◆ hash2() [2/15]

static unsigned int bdlb::HashUtil::hash2 ( bsls::Types::Uint64  key)
static

◆ hash2() [3/15]

static unsigned int bdlb::HashUtil::hash2 ( char  key)
static

◆ hash2() [4/15]

static unsigned int bdlb::HashUtil::hash2 ( const char *  data,
int  length 
)
static

Return an unsigned integer hash value corresponding to the specified data of the specified length (in bytes). The behavior is undefined unless 0 <= length. Note that if data is 0, then length also must be 0. Also note that every byte in data is significant; that is, it is not appropriate to cast a struct address to a char * unless the struct is packed (no padding).

Both hash1 and hash2 return a hash, but both hashes can be assumed to be independent (i.e., there are no known correlations between the results of the two hash functions given the same input data).

◆ hash2() [5/15]

static unsigned int bdlb::HashUtil::hash2 ( const void *  key)
static

Return an unsigned integer hash value corresponding to the specified key. Note that the return value is seemingly random (i.e., the hash is good) but identical on all platforms (irrespective of endianness). Both functions hash1 and hash2 return a hash, but both hashes can be assumed to be independent (i.e., there are no known correlations between the results of both hash functions given the same input data).

◆ hash2() [6/15]

static unsigned int bdlb::HashUtil::hash2 ( double  key)
static

◆ hash2() [7/15]

static unsigned int bdlb::HashUtil::hash2 ( float  key)
static

◆ hash2() [8/15]

static unsigned int bdlb::HashUtil::hash2 ( int  key)
static

◆ hash2() [9/15]

static unsigned int bdlb::HashUtil::hash2 ( long  key)
static

◆ hash2() [10/15]

static unsigned int bdlb::HashUtil::hash2 ( short  key)
static

◆ hash2() [11/15]

static unsigned int bdlb::HashUtil::hash2 ( signed char  key)
static

◆ hash2() [12/15]

static unsigned int bdlb::HashUtil::hash2 ( unsigned char  key)
static

◆ hash2() [13/15]

static unsigned int bdlb::HashUtil::hash2 ( unsigned int  key)
static

◆ hash2() [14/15]

static unsigned int bdlb::HashUtil::hash2 ( unsigned long  key)
static

◆ hash2() [15/15]

static unsigned int bdlb::HashUtil::hash2 ( unsigned short  key)
static

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