コード例 #1
0
ファイル: htshash.c プロジェクト: eatonmi/Crawler
// calcul clé
// il n'y a pas de formule de hashage universelle, celle-ci semble acceptable..
unsigned long int hash_cle(char* nom1,char* nom2) {
  /*
  unsigned int sum=0;
  int i=0;
  while(*nom1) {
    sum += 1;
    sum += (unsigned int) *(nom1);
    sum *= (unsigned int) *(nom1++);
    sum += (unsigned int) i;
    i++;
  }
  while(*nom2) {
    sum += 1;
    sum += (unsigned int) *(nom2);
    sum *= (unsigned int) *(nom2++);
    sum += (unsigned int) i;
    i++;
  }
  */
  return md5sum32(nom1)
        +md5sum32(nom2);
}
コード例 #2
0
ファイル: htsinthash.c プロジェクト: yoyossy/www.memobio.fr
static unsigned long int inthash_key(const char *value) {
  return md5sum32(value);
}