xref: /memcached-1.4.29/hash.c (revision 05ca809c)
11a070652STrond Norbye /* -*- Mode: C; tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2*05ca809cSdormando 
31a070652STrond Norbye #include "memcached.h"
4*05ca809cSdormando #include "jenkins_hash.h"
5*05ca809cSdormando #include "murmur3_hash.h"
61a070652STrond Norbye 
hash_init(enum hashfunc_type type)7*05ca809cSdormando int hash_init(enum hashfunc_type type) {
8*05ca809cSdormando     switch(type) {
9*05ca809cSdormando         case JENKINS_HASH:
10*05ca809cSdormando             hash = jenkins_hash;
11*05ca809cSdormando             settings.hash_algorithm = "jenkins";
121a070652STrond Norbye             break;
13*05ca809cSdormando         case MURMUR3_HASH:
14*05ca809cSdormando             hash = MurmurHash3_x86_32;
15*05ca809cSdormando             settings.hash_algorithm = "murmur3";
161a070652STrond Norbye             break;
17*05ca809cSdormando         default:
18*05ca809cSdormando             return -1;
191a070652STrond Norbye     }
20*05ca809cSdormando     return 0;
211a070652STrond Norbye }
22