Patches from Piotr Sikora < piotr.sikora@frickle.com > for OpenBSD.
[m6w6/libmemcached] / libmemcached / hash.c
index e6458c25d816f3e7288c95403b78958ced90c93b..dbdcc7ded0f13f122ac42c96ec095092e7ce5b49 100644 (file)
@@ -1,9 +1,20 @@
+/* LibMemcached
+ * Copyright (C) 2006-2010 Brian Aker
+ * All rights reserved.
+ *
+ * Use and distribution licensed under the BSD license.  See
+ * the COPYING file in the parent directory for full text.
+ *
+ * Summary: 
+ *
+ */
+
 #include "common.h"
 
 
 uint32_t memcached_generate_hash_value(const char *key, size_t key_length, memcached_hash_t hash_algorithm)
 {
-  return libhashkit_generate_value(key, key_length, (hashkit_hash_algorithm_t)hash_algorithm);
+  return libhashkit_digest(key, key_length, (hashkit_hash_algorithm_t)hash_algorithm);
 }
 
 uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length)
@@ -16,7 +27,7 @@ uint32_t generate_hash(memcached_st *ptr, const char *key, size_t key_length)
   if (memcached_server_count(ptr) == 1)
     return 0;
 
-  hash= hashkit_generate_value(&ptr->hashkit, key, key_length);
+  hash= hashkit_digest(&ptr->hashkit, key, key_length);
   WATCHPOINT_ASSERT(hash);
 
   return hash;
@@ -107,3 +118,8 @@ uint32_t memcached_generate_hash(memcached_st *ptr, const char *key, size_t key_
 
   return dispatch_host(ptr, hash);
 }
+
+hashkit_st *memcached_get_hashkit(memcached_st *ptr)
+{
+  return &ptr->hashkit;
+}