How To Install triehash on Fedora 34

triehash is Generator for order-preserving minimal perfect hash functions in C

Introduction

In this tutorial we learn how to install triehash on Fedora 34.

What is triehash

TrieHash generates perfect hash functions as C code which then gets compiled into optimal machine code as part of the usual program compilation. TrieHash works by translating a list of strings to a trie, and then converting the trie to a set of recursive switch statements; first switching by length, and then switching by bytes. TrieHash has various optimizations such as processing multiple bytes at once (on GNU C), and shortcuts for reducing the complexity of case-insensitive matching (ASCII only). Generated code performs substantially faster than gperf, but is larger. TrieHash was written for use in APT.

We can use yum or dnf to install triehash on Fedora 34. In this tutorial we discuss both methods but you only need to choose one of method to install triehash.

Install triehash on Fedora 34 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install triehash using dnf by running the following command:

sudo dnf -y install triehash

Install triehash on Fedora 34 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

Fedora 34 - x86_64                               20 kB/s | 6.6 kB     00:00
Fedora 34 openh264 (From Cisco) - x86_64        1.4 kB/s | 989  B     00:00
Fedora Modular 34 - x86_64                       68 kB/s | 6.5 kB     00:00
Fedora 34 - x86_64 - Updates                    3.5 kB/s | 6.2 kB     00:01
Fedora Modular 34 - x86_64 - Updates             17 kB/s | 5.9 kB     00:00
Metadata cache created.

After updating yum database, We can install triehash using yum by running the following command:

sudo yum -y install triehash

How To Uninstall triehash on Fedora 34

To uninstall only the triehash package we can use the following command:

sudo dnf remove triehash

triehash Package Contents on Fedora 34

/usr/bin/triehash
/usr/share/doc/triehash
/usr/share/doc/triehash/README.md
/usr/share/licenses/triehash
/usr/share/licenses/triehash/LICENSE.md
/usr/share/man/man1/triehash.1.gz

References

Summary

In this tutorial we learn how to install triehash on Fedora 34 using yum and dnf.