Is there any good hash library in c/c++?

Z

Zhiqiang Ye

Hi,dear all,
I know there is a hash library in glibc, it's head file is search.h. One
can use hash map based on this.But its hash is global , there could be only
one hash structrue at one time. Is there good hash library to that I can use
it as a local data structure? Thanks a lot!

Zhiqiang Ye
 
E

Emmanuel Delahaye

[The is no C/C++. There is C and there is C++. They are different languages.]
Hi,dear all,
I know there is a hash library in glibc, it's head file is search.h.
One
can use hash map based on this.But its hash is global , there could be
only one hash structrue at one time. Is there good hash library to that
I can use it as a local data structure? Thanks a lot!

http://users.footprints.net/~kaz/kazlib_doc/index.html
 
C

CBFalconer

Zhiqiang said:
I know there is a hash library in glibc, it's head file is
search.h. One can use hash map based on this. But its hash is
global , there could be only one hash structrue at one time. Is
there good hash library to that I can use it as a local data
structure? Thanks a lot!

There is no such language as C/C++. You need to make up your
mind.

C++ can call code written in C. Whether the result will function
correctly is dependent on various facets of your system, and
off-topic here.

I have written a hash table library in purely portable standard
C. It is re-entrant, so can handle many structures with the same
code. It is available under the GPL licence, and other licences
may be negotiated should you not wish to release your own code.
See:

<http://cbfalconer.home.att.net/download/hashlib.zip>
 
Z

Zhiqiang Ye

Thank you very much.
[The is no C/C++. There is C and there is C++. They are different languages.]
Hi,dear all,
I know there is a hash library in glibc, it's head file is search.h.
One
can use hash map based on this.But its hash is global , there could be
only one hash structrue at one time. Is there good hash library to that
I can use it as a local data structure? Thanks a lot!

http://users.footprints.net/~kaz/kazlib_doc/index.html

--
-ed- get my email here: http://marreduspam.com/ad672570
The C-language FAQ: http://www.eskimo.com/~scs/C-faq/top.html
C-reference: http://www.dinkumware.com/manuals/reader.aspx?lib=c99
FAQ de f.c.l.c : http://www.isty-info.uvsq.fr/~rumeau/fclc/
 
Z

Zhiqiang Ye

There is no such language as C/C++. You need to make up your
mind.
Thanks. Actually, I am just doing some scientific calculation, so I am not
so clear about programing. I often write c style code, mixed with some
c++ charateristics . :)

C++ can call code written in C. Whether the result will function
correctly is dependent on various facets of your system, and
off-topic here.

I have written a hash table library in purely portable standard
C. It is re-entrant, so can handle many structures with the same
code. It is available under the GPL licence, and other licences
may be negotiated should you not wish to release your own code.

I don't know the meaning of "reentrant" before, but now since you mentioned
this, I see.
Since the search.h in glibc, provides a reentrant function for hash table if
we #define _GNU_SOURCE, I can just use glibc. Is this right?
 
B

Ben Pfaff

Zhiqiang Ye said:
Since the search.h in glibc, provides a reentrant function for hash table if
we #define _GNU_SOURCE, I can just use glibc. Is this right?

You can use that if you don't mind that your code will only work
with glibc. But Chuck's library (if I recall correctly) is
portable, so you can use it regardless of the system C library.
 
C

CBFalconer

Zhiqiang said:
.... snip ...
Since the search.h in glibc, provides a reentrant function for
hash table if we #define _GNU_SOURCE, I can just use glibc.
Is this right?

No. There is no such routine in standard portable C. See the
welcome message to this group, which was recently reposted.
 
?

=?iso-8859-1?q?Nils_O=2E_Sel=E5sdal?=

Hi,dear all,
I know there is a hash library in glibc, it's head file is search.h. One
can use hash map based on this.But its hash is global , there could be only
one hash structrue at one time. Is there good hash library to that I can use
it as a local data structure? Thanks a lot!
glibc has various _r (e.g. hsearc_r) which is not global.
It's probably not portable outside glibc systems though.
 
Joined
Sep 6, 2006
Messages
2
Reaction score
0
Lbc Hash

Well, although this thread seems quite old... let me introduce the LBC HASH C library, that can be found in http://www.uberum.com

although it's not finished (is quite beta yet and no proper doc available) the tarball you can download it containes a test.c file where you can see how it looks like.

The weakest point is the hash function itself that is the trivial one (sum of bytes and module ) , I'm still evaluating which one to use blaancing the quality of the algorithm and the cost.

However, in the incoming days I'll start to create the proper doc in http://www.uberum.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top