133Fermer135
GodzilLe 12/10/2007 à 13:22
non DJBHash c'est l'originale du soft

unsigned int DJBHash(char* str, unsigned int len)
{
   unsigned int hash = 5381;
   unsigned int i    = 0;

   for(i = 0; i < len; str++, i++)
   {
      hash = ((hash << 5) + hash) + (*str);
   }

   return hash;
}


(et tes fonctions, enfin le "con" je l'ai modifié car l'API passe en parametre la longueur)