prepare v1.1.4
[awesomized/libmemcached] / src / libhashkit / digest.cc
index 3ea5588f05ee2d561a640304ea95851138c7e9d2..3e1bb31d9b72e1ca6838a8f220ff34c5e140e68c 100644 (file)
@@ -1,6 +1,6 @@
 /*
     +--------------------------------------------------------------------+
-    | libmemcached - C/C++ Client Library for memcached                  |
+    | libmemcached-awesome - C/C++ Client Library for memcached          |
     +--------------------------------------------------------------------+
     | Redistribution and use in source and binary forms, with or without |
     | modification, are permitted under the terms of the BSD license.    |
@@ -9,7 +9,7 @@
     | the terms online at: https://opensource.org/licenses/BSD-3-Clause  |
     +--------------------------------------------------------------------+
     | Copyright (c) 2006-2014 Brian Aker   https://datadifferential.com/ |
-    | Copyright (c) 2020 Michael Wallner   <mike@php.net>                |
+    | Copyright (c) 2020-2021 Michael Wallner        https://awesome.co/ |
     +--------------------------------------------------------------------+
 */
 
@@ -22,20 +22,28 @@ uint32_t hashkit_digest(const hashkit_st *self, const char *key, size_t key_leng
 uint32_t libhashkit_digest(const char *key, size_t key_length,
                            hashkit_hash_algorithm_t hash_algorithm) {
   switch (hash_algorithm) {
-  case HASHKIT_HASH_DEFAULT: return libhashkit_one_at_a_time(key, key_length);
-  case HASHKIT_HASH_MD5: return libhashkit_md5(key, key_length);
-  case HASHKIT_HASH_CRC: return libhashkit_crc32(key, key_length);
-  case HASHKIT_HASH_FNV1_64: return libhashkit_fnv1_64(key, key_length);
-  case HASHKIT_HASH_FNV1A_64: return libhashkit_fnv1a_64(key, key_length);
-  case HASHKIT_HASH_FNV1_32: return libhashkit_fnv1_32(key, key_length);
-  case HASHKIT_HASH_FNV1A_32: return libhashkit_fnv1a_32(key, key_length);
+  case HASHKIT_HASH_DEFAULT:
+    return libhashkit_one_at_a_time(key, key_length);
+  case HASHKIT_HASH_MD5:
+    return libhashkit_md5(key, key_length);
+  case HASHKIT_HASH_CRC:
+    return libhashkit_crc32(key, key_length);
+  case HASHKIT_HASH_FNV1_64:
+    return libhashkit_fnv1_64(key, key_length);
+  case HASHKIT_HASH_FNV1A_64:
+    return libhashkit_fnv1a_64(key, key_length);
+  case HASHKIT_HASH_FNV1_32:
+    return libhashkit_fnv1_32(key, key_length);
+  case HASHKIT_HASH_FNV1A_32:
+    return libhashkit_fnv1a_32(key, key_length);
   case HASHKIT_HASH_HSIEH:
 #ifdef HAVE_HSIEH_HASH
     return libhashkit_hsieh(key, key_length);
 #else
     return 1;
 #endif
-  case HASHKIT_HASH_MURMUR3: return libhashkit_murmur3(key, key_length);
+  case HASHKIT_HASH_MURMUR3:
+    return libhashkit_murmur3(key, key_length);
 
   case HASHKIT_HASH_MURMUR:
 #ifdef HAVE_MURMUR_HASH
@@ -43,7 +51,8 @@ uint32_t libhashkit_digest(const char *key, size_t key_length,
 #else
     return 1;
 #endif
-  case HASHKIT_HASH_JENKINS: return libhashkit_jenkins(key, key_length);
+  case HASHKIT_HASH_JENKINS:
+    return libhashkit_jenkins(key, key_length);
   case HASHKIT_HASH_CUSTOM:
   case HASHKIT_HASH_MAX:
   default: