There are many Hashing alogrithms in use today. Some strong hashing alogrithms are 'Message Digest' (MD4, MD5), secure hash alogrithm (SHA-1), various DES, etc. They all fall under category of cryptographic services. They are intended for secured environments. But they normally take some level of processing power (although negligible on modern PCs). You can choose a simpler solution such as checksums (CRC) . Cyclic Redundancy Check a.k.a CRC32 is not quite a secure one but can provide enough integrity checks on the contents. If you want to learn more on these :
http://en.wikipedia.org/wiki/Cryptographic_hash_function
http://en.wikipedia.org/wiki/Cyclic_redundancy_check
I think STL (standard template library ) won't be the choice since you want to create your own routing.
If your hash table just for use such search ,sort, etc, you can use the following snippet shown below. It is a very simple hashing technique by XOR.ing the integer values. It is very fast as well.
int ILibGetHashValue(void *key, int keylength)
{
int HashValue=0;
char TempValue[4];
if(keylength<=4)
{
//
// If the key length is <= 4, the hash is just the key expressed as an integer
//
memset(TempValue,0,4);
memcpy(TempValue,key,keylength);
// MEMCHECK(assert(keylength<=4)
// !! you can neglect this line
HashValue = *((int*)TempValue);
}
else
{
//
// If the key length is >4, the hash is the first 4 bytes XOR with the last 4
//
memcpy(TempValue,key,4);
HashValue = *((int*)TempValue);
memcpy(TempValue,(char*)key+(keylength-4),4);
HashValue = HashValue^(*((int*)TempValue));
//
// If the key length is >= 10, the hash is also XOR with the middle 4 bytes
//
if(keylength>=10)
{
memcpy(TempValue,(char*)key+(keylength/2),4);
HashValue = HashValue^(*((int*)TempValue));
}
}
return(HashValue);
}