3 ms·
For those of us who actually ship code, I'd like to suggest khash[1], which is a pretty nice implementation of a hash table in C. It uses lot's of macros, so if
by jakobegger 12y ago
For those of us who actually ship code, I'd like to suggest khash[1], which is a pretty nice implementation of a hash table in C. It uses lot's of macros, so if you're looking for a brain teaser you will be satisfied as well :)
[1]: http://attractivechaos.github.io/klib/#Khash%3A%20generic%20hash%20table:%5B%5BKhash%3A%20generic%20hash%20table%5D%5D http://attractivechaos.github.io/klib/#Khash%3A%20generic%20...
- AntiRush 12y agouthash[1] is another good solution. It's pretty bulletproof and has lots of options. Also implemented with macros, if that's a plus :-). [1]: http://troydhanson.github.io/uthash/ http://troydhanson.github.io/uthash/
- gjulianm 12y agoI don't think being implemented with macros is a plus. I've seen some friends use it and get stuck whenever it was failing because it's impossible to know how it's working. It's the same type of cleverness some people criticize in other comments. Yes, it may be complete and useful but it's opaque.
- cel 12y agoSee also clibs/hash[1], which provides a friendly API on top of khash. [1]: https://github.com/clibs/hash https://github.com/clibs/hash