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: thehashkit_hsieh(),hashkit_murmur()andhashkit_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
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- fedora 43: libmemcached-awesome-devel 1.1.4-7.fc43 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms