2 * Copyright (C) 2010 Brian Aker
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
11 uint32_t hashkit_digest(const hashkit_st
*self
, const char *key
, size_t key_length
)
13 return self
->base_hash
.function(key
, key_length
, self
->base_hash
.context
);
16 uint32_t libhashkit_digest(const char *key
, size_t key_length
, hashkit_hash_algorithm_t hash_algorithm
)
18 switch (hash_algorithm
)
20 case HASHKIT_HASH_DEFAULT
:
21 return libhashkit_one_at_a_time(key
, key_length
);
22 case HASHKIT_HASH_MD5
:
23 return libhashkit_md5(key
, key_length
);
24 case HASHKIT_HASH_CRC
:
25 return libhashkit_crc32(key
, key_length
);
26 case HASHKIT_HASH_FNV1_64
:
27 return libhashkit_fnv1_64(key
, key_length
);
28 case HASHKIT_HASH_FNV1A_64
:
29 return libhashkit_fnv1a_64(key
, key_length
);
30 case HASHKIT_HASH_FNV1_32
:
31 return libhashkit_fnv1_32(key
, key_length
);
32 case HASHKIT_HASH_FNV1A_32
:
33 return libhashkit_fnv1a_32(key
, key_length
);
34 case HASHKIT_HASH_HSIEH
:
35 #ifdef HAVE_HSIEH_HASH
36 return libhashkit_hsieh(key
, key_length
);
40 case HASHKIT_HASH_MURMUR
:
41 return libhashkit_murmur(key
, key_length
);
42 case HASHKIT_HASH_JENKINS
:
43 return libhashkit_jenkins(key
, key_length
);
44 case HASHKIT_HASH_CUSTOM
:
45 case HASHKIT_HASH_MAX
:
48 fprintf(stderr
, "hashkit_hash_t was extended but libhashkit_generate_value was not updated\n");