HASHKIT_CRC32(3)

πŸ’– HASHKIT_CRC32(3) πŸ’–

okay so bestie, welcome to hashkit_crc32 β€” the libhashkit documentation page that's lowkey the whole hash algorithm squad. this is from libmemcached-awesome and it's giving "one page, ten hash functions, zero notes". let's go πŸ¦‹


✨ NAME ✨

hashkit_crc32 β€” libhashkit Documentation. yes that's it, that's the name. short, sweet, iconic πŸ’…


🌸 SYNOPSIS 🌸

first things first, you gotta pull in the header:

#include <libhashkit-1.0/hashkit.h>

and then, and this is important bestie, compile and link with -lhashkit. no -lhashkit, no vibes. 😭

here's the whole lineup of function signatures, character for character:

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)

that's eleven functions, one page, all of them take a const char *key and a size_t key_length and hand you back a uint32_t. the way they all match... coordinated. main character energy fr fr πŸ‘‘


πŸŽ€ DESCRIPTION πŸŽ€

so what are these little guys actually doing? these functions generate hash values from a key using a variety of algorithms. that's the whole deal. you give them a key, they give you a number. manifesting ✨

and the best part? they're flexible like that. these functions can be used standalone β€” like, you can just call one directly and go about your day β€” or they'll be used according to the algorithm set with hashkit_set_function() or hashkit_set_distribution_function(). so you can either pick your fave manually or let the library pick it for you. both valid, both slay. 🫢

⚠️ okay heads up, this is the important bit: the hashkit_hsieh(), hashkit_murmur() and hashkit_murmur3() functions are only available if the library is built with the appropriate flag enabled. so if those three are ghosting you, it's not personal, it's a build flag. build config said "not today" πŸ’€

🌈 RETURN VALUE 🌈

a 32-bit hash value. that's it. that's the tea. β˜•


⭐ SEE ALSO ⭐

go read these next, they're all in the family:


and that's the page!! πŸŽ‰ the manual name is hashkit_crc32, it lives under section 3 of the manual, and the version info is literally 1.1 dated Jul 24, 2025 β€” and the source is the one and only libmemcached-awesome. periodt. πŸ’–βœ¨πŸŒΈπŸ¦‹πŸ’…

πŸ“¦ where this page comes from