X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=src%2Flibhashkit%2Fdigest.cc;h=3e1bb31d9b72e1ca6838a8f220ff34c5e140e68c;hb=6f1f694418c7effef13972ea135ce1c735042a8f;hp=3ea5588f05ee2d561a640304ea95851138c7e9d2;hpb=1a82d708fca6b4c379dc035d05763ee80aae6d72;p=awesomized%2Flibmemcached diff --git a/src/libhashkit/digest.cc b/src/libhashkit/digest.cc index 3ea5588f..3e1bb31d 100644 --- a/src/libhashkit/digest.cc +++ b/src/libhashkit/digest.cc @@ -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 | + | 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: