J
January Weiner
Hello,
I need to use a hashing function for relatively short strings (roughly 16
characters or less). The data that needs to be accessed via hash is just a
simple int. I just need to look up values in two dimensional matrices each
time that I encounter a pair of these strings.
I would like to keep the code as simple and standard as
possible, but at the same time to have a reasonable performance.
While looking through the docs on my system I found a few different
implementations:
- hsearch from <search.h>
- tsearch from <search.h>
- bsearch from <stdlib.h>
Which one would you recommend? Or maybe something completly different?
Right now I just use Perl to do the hashing this is nice, but I would
love to have a small, efficient, ANSI C program.
Regards,
January
I need to use a hashing function for relatively short strings (roughly 16
characters or less). The data that needs to be accessed via hash is just a
simple int. I just need to look up values in two dimensional matrices each
time that I encounter a pair of these strings.
I would like to keep the code as simple and standard as
possible, but at the same time to have a reasonable performance.
While looking through the docs on my system I found a few different
implementations:
- hsearch from <search.h>
- tsearch from <search.h>
- bsearch from <stdlib.h>
Which one would you recommend? Or maybe something completly different?
Right now I just use Perl to do the hashing this is nice, but I would
love to have a small, efficient, ANSI C program.
Regards,
January