Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. C
  3. jwHash

jwHash

Apache-2.0C

A simple, portable hash table implementation for C with support for multiple data types and optional thread safety.

GitHubGitHub
220 stars24 forks0 contributors

What is jwHash?

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.

Target Audience

C developers working on embedded systems, command-line tools, or applications that need efficient in-memory data storage without external library dependencies.

Value Proposition

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.

Overview

Simple hash table implementation for C.

Use Cases

Best For

  • Adding key-value storage to C applications without external dependencies
  • Embedded systems programming where library size matters
  • Building configuration managers for C programs
  • Creating in-memory caches for performance-sensitive applications
  • Educational purposes for learning hash table implementation
  • Multi-threaded C programs needing thread-safe data structures

Not Ideal For

  • Applications requiring automatic hash table resizing and load balancing
  • Projects that need efficient iteration over all keys or values
  • Systems where memory overhead from mandatory string copying is prohibitive
  • High-performance computing with custom hash function or data structure requirements

Pros & Cons

Pros

Multiple Data Types

Supports strings, long integers, doubles, and pointers as both keys and values, providing flexibility for diverse C applications as shown in the API examples.

Automatic String Safety

Copies strings on storage and retrieval to prevent memory issues, ensuring safety without manual management, as highlighted in the README's features.

Optional Thread Safety

Includes bucket-level locking for safe concurrent access with minimal performance impact, evidenced by multi-threaded benchmarks scaling with processor count.

Lightweight Portability

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.

Cons

Missing Dynamic Resizing

Rehashing to a larger table is not yet implemented, as admitted in the TODO list, which can lead to performance degradation as data grows.

No Iteration Support

Lacks callback functions for iterating through keys and values, a feature explicitly listed as pending in the TODO, limiting data exploration.

Code Duplication Issues

The author plans to restructure to a macro-based style to cut down duplication, indicating current inefficiencies and maintenance challenges.

Frequently Asked Questions

Quick Stats

Stars220
Forks24
Contributors0
Open Issues2
Last commit5 years ago
CreatedSince 2015

Tags

#hash-table#memory-management#embedded#portable#data-structures#c#key-value-store#thread-safe

Built With

C
C++

Included in

C3.8k
Auto-fetched 19 hours ago

Related Projects

murmurmurmur

Intel® Implicit SPMD Program Compiler

Stars2,927
Forks348
Last commit2 days ago
libcrclibcrc

Murmur3 hash in C

Stars445
Forks89
Last commit4 years ago
t1hat1ha

One of the fastest hash functions.

Stars367
Forks31
Last commit1 year ago
xxHashxxHash

Extremely fast non-cryptographic hash algorithm. 2-clause BSD

Stars0
Forks0
Last commit
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub