8#ifndef INCLUDED_BDLB_HASHUTIL
9#define INCLUDED_BDLB_HASHUTIL
769#include <bdlscm_version.h>
786 static unsigned int hash0(
char key,
int modulus);
787 static unsigned int hash0(
signed char key,
int modulus);
788 static unsigned int hash0(
unsigned char key,
int modulus);
789 static unsigned int hash0(
short key,
int modulus);
790 static unsigned int hash0(
unsigned short key,
int modulus);
791 static unsigned int hash0(
int key,
int modulus);
792 static unsigned int hash0(
unsigned int key,
int modulus);
793 static unsigned int hash0(
long key,
int modulus);
794 static unsigned int hash0(
unsigned long key,
int modulus);
797 static unsigned int hash0(
float key,
int modulus);
798 static unsigned int hash0(
double key,
int modulus);
805 static unsigned int hash0(
const void *key,
int modulus);
813 static unsigned int hash0(
const char *
string,
int modulus);
815 static unsigned int hash0(
const char *
string,
827 static unsigned int hash1(
const char *data,
int length);
840 static unsigned int hash2(
const char *data,
int length);
842 static unsigned int hash1(
char key);
843 static unsigned int hash1(
signed char key);
844 static unsigned int hash1(
unsigned char key);
845 static unsigned int hash1(
short key);
846 static unsigned int hash1(
unsigned short key);
848 static unsigned int hash1(
unsigned int key);
849 static unsigned int hash1(
long key);
850 static unsigned int hash1(
unsigned long key);
853 static unsigned int hash1(
float key);
854 static unsigned int hash1(
double key);
862 static unsigned int hash1(
const void *key);
864 static unsigned int hash2(
char key);
865 static unsigned int hash2(
signed char key);
866 static unsigned int hash2(
unsigned char key);
867 static unsigned int hash2(
short key);
868 static unsigned int hash2(
unsigned short key);
870 static unsigned int hash2(
unsigned int key);
871 static unsigned int hash2(
long key);
872 static unsigned int hash2(
unsigned long key);
875 static unsigned int hash2(
float key);
876 static unsigned int hash2(
double key);
884 static unsigned int hash2(
const void *key);
901 if (4 ==
sizeof(
int)) {
902 return static_cast<unsigned int>(key)
903 %
static_cast<unsigned int>(modulus);
906 return (
static_cast<unsigned int>(key) & 0xFFFFFFFF)
907 %
static_cast<unsigned int>(modulus);
915 return ((
static_cast<unsigned int>((key >> 32) & 0xFFFFFFFF)
916 %
static_cast<unsigned int>(modulus))
917 ^
static_cast<unsigned int>(key & 0xFFFFFFFF))
918 %
static_cast<unsigned int>(modulus);
926 return HashUtil::hash0(
static_cast<int>(
static_cast<unsigned char>(key)),
935 return HashUtil::hash0(
static_cast<int>(
static_cast<unsigned char>(key)),
952 return HashUtil::hash0(
static_cast<int>(
static_cast<unsigned short>(key)),
977 if (4 ==
sizeof(
long)) {
979 static_cast<int>(
static_cast<unsigned long>(key)),
994 if (4 ==
sizeof(
unsigned long)) {
1033 if (4 ==
sizeof(
void *)) {
1034 const int *v =
reinterpret_cast<const int *
>(&key);
1039 static_cast<const void *
>(&key));
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlb_algorithmworkaroundutil.h:74
This struct provides a namespace for hash functions.
Definition bdlb_hashutil.h:782
static unsigned int hash2(unsigned int key)
static unsigned int hash1(float key)
static unsigned int hash0(char key, int modulus)
Definition bdlb_hashutil.h:922
static unsigned int hash2(signed char key)
static unsigned int hash2(float key)
static unsigned int hash0(const char *string, int modulus)
static unsigned int hash2(unsigned short key)
static unsigned int hash0(const char *string, int stringLength, int modulus)
static unsigned int hash1(const void *key)
static unsigned int hash1(unsigned short key)
static unsigned int hash1(bsls::Types::Uint64 key)
static unsigned int hash2(unsigned char key)
static unsigned int hash2(const void *key)
static unsigned int hash2(int key)
static unsigned int hash1(double key)
static unsigned int hash1(signed char key)
static unsigned int hash2(char key)
static unsigned int hash2(bsls::Types::Int64 key)
static unsigned int hash2(bsls::Types::Uint64 key)
static unsigned int hash1(int key)
static unsigned int hash1(unsigned char key)
static unsigned int hash1(unsigned int key)
static unsigned int hash1(char key)
static unsigned int hash2(double key)
static unsigned int hash1(short key)
static unsigned int hash1(unsigned long key)
static unsigned int hash2(const char *data, int length)
static unsigned int hash1(const char *data, int length)
static unsigned int hash2(short key)
static unsigned int hash2(unsigned long key)
static unsigned int hash1(bsls::Types::Int64 key)
static unsigned int hash1(long key)
static unsigned int hash2(long key)
unsigned long long Uint64
Definition bsls_types.h:137
long long Int64
Definition bsls_types.h:132