A type-safe, dynamic hash table for C11. Store any type — int, float, string, pointer — with a single unified API. Auto-resizing, FNV-1a hashing, and zero dependencies.
Built on proven algorithms with a clean, macro-driven interface that feels natural in any C11 codebase.
_Generic selects the right variant constructor at compile time. Use strings, ints, floats, or void pointers as keys or values.hashmap_print_view() reports exact memory usage: struct, bucket table, nodes, and heap strings — in human-readable units.-0.0f hash normalization, NULL pointer keys, string allocation failures, and integer overflow in bucket sizing.Six public macros cover everything. Internal functions are prefixed with double underscores and stay out of your way.
After inserting keys the table distributes entries across buckets via hash modulo. Resize keeps load between 25% and 75%.
Two files. Drop them in. Start hashing.
hashmap.h and hashmap.c into your project directory. No build system required.-std=c11 or later.hashmap.c alongside your source. The only standard dependency is libc.