HASHKIT_MD5(3)

πŸ’– HASHKIT_MD5 πŸ’–

okay bestie so this is hashkit_md5(3) from the libmemcached-awesome fam, and it lives in the libhashkit girlie universe ✨ β€” that's the hashing side of the whole operation. come sit with me, we're gonna go through the whole thing πŸŽ€


✨ SYNOPSIS ✨

first things first, you gotta pull in the header and link the library, no cap:

#include <libhashkit-1.0/hashkit.h>
Compile and link with -lhashkit

and then here's the full lineup of functions, all of them built exactly like this πŸ‘‡

uint32_t hashkit_default(const char *key, size_t key_length)
uint32_t hashkit_fnv1_64(const char *key, size_t key_length)
uint32_t hashkit_fnv1a_64(const char *key, size_t key_length)
uint32_t hashkit_fnv1_32(const char *key, size_t key_length)
uint32_t hashkit_fnv1a_32(const char *key, size_t key_length)
uint32_t hashkit_crc32(const char *key, size_t key_length)
uint32_t hashkit_hsieh(const char *key, size_t key_length)
uint32_t hashkit_murmur(const char *key, size_t key_length)
uint32_t hashkit_murmur3(const char *key, size_t key_length)
uint32_t hashkit_jenkins(const char *key, size_t key_length)
uint32_t hashkit_md5(const char *key, size_t key_length)

like… look at that consistency. every single one takes a const char *key and a size_t key_length, and every single one hands you back a uint32_t. iconic behavior fr fr πŸ‘‘


🌸 DESCRIPTION 🌸

so what do these bad boys actually do? they take a key and crank out a hash value using a whole lil buffet of different algorithms πŸ’… that's the whole vibe.

and here's the cute part β€” you can use these standalone, just call one and go, OR the library will reach for them on your behalf based on whichever algorithm you set with hashkit_set_function() or hashkit_set_distribution_function(). so they're like, both the main character and the supporting cast. range!! πŸ¦‹

okay important tea though, and I'm not being dramatic: hashkit_hsieh(), hashkit_murmur() and hashkit_murmur3() are only available if the library is built with the appropriate flag enabled. like, they will not be there for you if that flag wasn't on when it got compiled. check before you get attached 😭

⭐ RETURN VALUE ⭐

a 32-bit hash value. that's it, that's the gift. uint32_t, every time, no surprises, no crumbs 🫢


πŸ‘‘ SEE ALSO πŸ‘‘

go read these next, bestie, they're the extended universe:


and that's the whole page!! this one's version 1.1, dated Jul 24, 2025, straight outta the libmemcached-awesome crew πŸ’œ mwah, go hash something, you're doing amazing sweetie 🌈✨

πŸ“¦ where this page comes from