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 install Chrome on Fedora Linux?

    How to install the Chrome browser on Fedora Linux from Google? Google provides a repository for yum/dnf on Fedora. First, following http://www.systutorials.com/3471/additional-repositories-for-fedora-linux/#google-chrome-repository to add Google Chrome repository. Then, you can install Google Chrome by yum/dnf: # dnf install google-chrome-stable Read more: How to install JRE for Chrome on Linux x86-64 Chrome’s KDE proxy integration broken…

  • How to write a autostart script for gnome

    I want to automatically run a program when I log in gnome. How to write a autorun script for it? Here is one example: $ cat ~/.config/autostart/dropbox.py.desktop [Desktop Entry] Comment[en_US]= Comment= Exec=/home/zma/bin/dropbox.py start GenericName[en_US]= GenericName= Icon=system-run MimeType= Name[en_US]= Name= Path= StartupNotify=true Terminal=false TerminalOptions= Type=Application X-DBUS-ServiceName= X-DBUS-StartupType= X-KDE-SubstituteUID=false X-KDE-Username= To set up a new one, you…

  • |

    How to Set Up Password-less SSH Login on Linux

    Automatic passwrod-less ssh login can make our life easier. To enable this, we have 2 options: using key-based authentication by copying our SSH public keys to the remote machines for automatic password-less login or using password-based authentication. I will introduce the 2 options in the post. Before you start, please note that key-based authentication is…

  • Fedora 中文字体设置

    Fedora 一直有中文字体难看的问题, 尤其是在英文环境中. 使用本文中的配置方法可以得到令人满意的中文效果. 此方案中使用字体都为开源且在Fedora源中自带. 此方案对 Fedora 9 – 20 有效. 对于后续版本支持我会确认并更新此文章. 此方案对Gnome, KDE都有效. Firefox 中也有中文难看的问题, 后面会提到. 快速配置方法 如果你想马上配置好,请使用如下命令。此方法测试使用效果良好。 # yum install cjkuni-ukai-fonts cjkuni-uming-fonts # wget https://raw.githubusercontent.com/zma/config_files/master/others/local.conf \ -O /etc/fonts/local.conf 相关英文字体配置可以参考:Improving Fedora Font Rendering with Open Software and Fonts Only. Fedora 系统中文字体的配置方案 使用uming和ukai字体,即AR PL UMing CN等. 中文字体和等宽字体效果如图所示(点击看大图, Firefox 中文字体设置在后面会提到). 方法如下: 安装字体 首先安装这两个字体: cjkuni-ukai-fonts cjkuni-uming-fonts (在Fedora…

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 *