Simple hash tables in c

I was working on a code where i had to lookup a structure based on the file descriptor (socket) again and again in a code, i was using a linked list initially but as the nodes grew i knew i should use a hash table, so i wrote a simple hash table implementation which did the work.

its a just works implementation there are a lot of thing which can be added like a perfect hash function but as long as hash table is not the bottle neck this should work, code can be found on github

file hashtable.h contains the definition

file hashtable.c contains the implementaion

file Makefile is the makefile

file main.c contains the sample

file debug.h contains some debugging options

Published: March 11 2011

  • category:
blog comments powered by Disqus