A simple, portable hash table implementation for C with support for multiple data types and optional thread safety.
jwHash is a simple hash table implementation written in C that provides key-value storage for various data types including strings, integers, doubles, and pointers. It solves the problem of needing a lightweight, portable associative array that can be easily integrated into C projects without complex dependencies.
C developers working on embedded systems, command-line tools, or applications that need efficient in-memory data storage without external library dependencies.
Developers choose jwHash for its simplicity, portability, and practical approach—it's designed to be easily understood and integrated while providing essential features like string copying safety and optional thread protection.
Simple hash table implementation for C.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports strings, long integers, doubles, and pointers as both keys and values, providing flexibility for diverse C applications as shown in the API examples.
Copies strings on storage and retrieval to prevent memory issues, ensuring safety without manual management, as highlighted in the README's features.
Includes bucket-level locking for safe concurrent access with minimal performance impact, evidenced by multi-threaded benchmarks scaling with processor count.
Designed to be easily dropped into C projects across platforms with a simple make-based build, making it ideal for embedded or dependency-free environments.
Rehashing to a larger table is not yet implemented, as admitted in the TODO list, which can lead to performance degradation as data grows.
Lacks callback functions for iterating through keys and values, a feature explicitly listed as pending in the TODO, limiting data exploration.
The author plans to restructure to a macro-based style to cut down duplication, indicating current inefficiencies and maintenance challenges.