Hashing Library for C

I try to find some Hashing libraries for C and find several good ones.

The hsearch function in the GNU C library.

There are other methods to organize information which later should be searched. The costs of insert, delete and search differ. One possible implementation is using hashing tables. The following functions are declared in the header file search.h.

CMPH – C Minimal Perfect Hashing Library.

The CMPH Library encapsulates the newest and more efficient algorithms in an easy-to-use, production-quality, fast API. The library was designed to work with big entries that cannot fit in the main memory. It has been used successfully for constructing minimal perfect hash functions for sets with more than 100 million of keys, and we intend to expand this number to the order of billion of keys.

libghthash.

libghthash is a Generic Hash Table which is meant to be easy to extend, portable, clear in its code and easy to use. You can store any kind of data in it, regardless of size etc. It should be fairly portable, and has been successfully tried on Linux/x86, Solaris/SPARC and Win2000/x86 so far.

Similar Posts

  • How to host multiple websites on a Apache Linux web server?

    I have a Linux web server with Apache (httpd). How to host multiple websites on Apache? To host websites www.example1.com and www.example2.com on a single node with Apache2 on a single IP, you can use VirtualHost as follows. Edit /etc/httpd/conf/httpd.conf and add the following lines: NameVirtualHost *:80 <VirtualHost *:80> DocumentRoot /var/www/example1.com ServerName www.example1.com # Other…

  • MFC程序使用系统风格界面

    VC6默认编译出来的程序在XP下Luma风格下运行也是Windows的经典界面, 有损界面的美观与统一. VC2008默认设置下如果不是使用的unicode也是如此. 本文给出使VC6和VC2008可以编译出使用系统界面风格的解决方案. 1. 使VC6编译出使用系统风格的程序 步骤如下: 1) 创建一个.manifest文件的资源. 在res/文件夹下创建一个跟以程序名加.manifest的文件, 如果程序为test.exe, 则创建test.exe.manifest 文件可由此下载: https://www.systutorials.com/t/g/programming/resultcollector.manifest/ 注意要使用utf-8编码保存。 2) 将新定义的资源加入到.rc2文件中, 类型设为24. 打开res/文件夹下的.rc2文件, 在其中加入如下定义: 1 24 MOVEABLE PURE “res/test.exe.manifest” 其中的文件地址按1)步中修改的设置即可. 之后编译即可, 为了使程序界面可能充分利用系统的界面特性, 可以将界面字体设置为TrueType类型的, 利用Windows XP等系统的屏幕字体平滑特性. 2. 使VC2008编译出使用系统风格的程序 在VC2008下就比较简单了, 如果程序字符集使用unicode则默认就是使用系统界面风格的, 如果选择其它的类型, 则编辑下stdafx.h即可. 最后面部分找到这么一段: #ifdef _UNICODE #if defined _M_IX86 #pragma comment(linker,”/manifestdependency:”type=’win32′ name=’Microsoft.Windows.Common-Controls’ version=’6.0.0.0′ processorArchitecture=’x86′ publicKeyToken=’6595b64144ccf1df’ language=’*'””) #elif defined _M_IA64 #pragma comment(linker,”/manifestdependency:”type=’win32’…

  • Hadoop 2 (YARN) default configuration values

    Where to check the default Hadoop 2 (YARN) configuration values for: HDFS: hdfs-site.xml YARN: yarn-site.xml MapReduce: mapred-site.xml Default Hadoop 2 (YARN) configuration values for Hadoop 2.2.0 from Apache Hadoop website: HDFS: http://hadoop.apache.org/docs/r2.2.0/hadoop-project-dist/hadoop-hdfs/hdfs-default.xml YARN: https://hadoop.apache.org/docs/r2.2.0/hadoop-yarn/hadoop-yarn-common/yarn-default.xml MapReduce: https://hadoop.apache.org/docs/r2.2.0/hadoop-mapreduce-client/hadoop-mapreduce-client-core/mapred-default.xml Read more: Good introductions to Hadoop 2.0 (YARN)? Hadoop Installation Tutorial (Hadoop 2.x) Hadoop Installation Tutorial (Hadoop 1.x) Hadoop…

One Comment

  1. An example of a piece of code using libghthash:

        ght_hash_table_t *tx_table = NULL;
        ppm_tx_id_t txid;
    
        // prepare the hash table
        tx_table = ght_create(HASH_TABLE_SIZE);
    
        // allow rehash. Note: rehashing is costly.
        ght_set_rehash(tx_table, TRUE);
    
    
        ...
    
    
        // check the hash whether the txid key exists
        pdata = ght_get(tx_table,
                sizeof(ppm_tx_id_t), &(txid));
    
        if (pdata != NULL) {
            // replace the entry in the hash table
            ght_replace(tx_table,
                    &type_b,
                    sizeof(ppm_tx_id_t), &(txid));
        } else {
            // insert to the hash
            ght_insert(tx_table,
                    &type_b,
                    sizeof(ppm_tx_id_t), &(txid));
        }
    

Leave a Reply

Your email address will not be published. Required fields are marked *