This simple tutorial shows how to install the most recent xxHash for faster hash checking in Ubuntu Linux.
xxHash is extremely fast non-cryptographic hash algorithm, working at RAM speed limit. It can be useful to check integrity for large amounts of data, index data, and/or used in cryptographic applications like digital signatures.
The library includes the following algorithms:
I’m new to hash algorithm, but doing hash check regularly when trying out different Linux distributions. And I use sha256, since the most sites provide sha256sum files for the hash code of their disco images.
It’s OK for me to run sha256sum for file in SSD, which takes around 20 seconds to print hash code for a 4 GB iso image. But after moving to USB stick (to boot via Ventoy), and hashing again it can take up to 2 minutes!
I was feeling stupid, until met xxHash. Hash checking can be so fast!
For advanced users, see the benchmarks (system uses an Intel i7-9700K cpu, and runs Ubuntu x64 20.04).
Hash Name | Width | Bandwidth (GB/s) | Small Data Velocity | Quality | Comment |
---|---|---|---|---|---|
XXH3 (SSE2) | 64 | 31.5 GB/s | 133.1 | 10 | |
XXH128 (SSE2) | 128 | 29.6 GB/s | 118.1 | 10 | |
memcpy | N/A | 28.0 GB/s | N/A | N/A | for reference |
City64 | 64 | 22.0 GB/s | 76.6 | 10 | |
T1ha2 | 64 | 22.0 GB/s | 99.0 | 9 | Slightly worse collisions |
City128 | 128 | 21.7 GB/s | 57.7 | 10 | |
XXH64 | 64 | 19.4 GB/s | 71.0 | 10 | |
SpookyHash | 64 | 19.3 GB/s | 53.2 | 10 | |
Mum | 64 | 18.0 GB/s | 67.0 | 9 | Slightly worse collisions |
XXH32 | 32 | 9.7 GB/s | 71.9 | 10 | |
City32 | 32 | 9.1 GB/s | 66.0 | 10 | |
Murmur3 | 32 | 3.9 GB/s | 56.1 | 10 | |
SipHash | 64 | 3.0 GB/s | 43.2 | 10 | |
FNV64 | 64 | 1.2 GB/s | 62.7 | 5 | Poor avalanche properties |
Blake2 | 256 | 1.1 GB/s | 5.1 | 10 | Cryptographic |
SHA1 | 160 | 0.8 GB/s | 5.6 | 10 | Cryptographic but broken |
MD5 | 128 | 0.6 GB/s | 7.8 | 10 | Cryptographic but broken |
xxHash is available in Ubuntu repository, but is (or will be) old since the software keeps moving with newer releases.
To install xxHash from system repository, open terminal (Ctrl+Alt+T
) and run command:
sudo apt install xxhash
For the latest version (so far v0.8.2), there are some third-party PPA repositories. And, I use the one from Adam Reviczky, which so far supports Ubuntu 20.04, Ubuntu 22.04, Ubuntu 23.04, and Ubuntu 23.10
Ctrl+Alt+T
on keyboard to open terminal. When it opens, run command to add the PPA: sudo add-apt-repository ppa:reviczky/xxhash
Type user password when it asks (no asterisk feedback) for sudo authentication. Then, hit Enter to continue.
sudo apt install xxhash
For Linux Mint, run sudo apt update
first to refresh system package cache.
After installing the tool, use one of xxh128sum
, xxh32sum
, xxh64sum
, xxhsum
commands to do hash checks.
To uninstall xxHash, open terminal (Ctrl+Alt+T) and run command:
sudo apt remove --autoremove xxhash
Also remove the PPA (if added), by either “Software & Updates” under “Other Software” tab, or running command:
sudo add-apt-repository --remove ppa:reviczky/xxhash
The post How to Install xxHash for faster hash check in Ubuntu appeared first on Osgrove.
2024 was the GenAI year. With new and more performant LLMs and a higher number…
Canonical’s Kubernetes LTS (Long Term Support) will support FedRAMP compliance and receive at least 12…
Welcome to the Ubuntu Weekly Newsletter, Issue 878 for the week of February 2 –…
At Canonical, we firmly believe that delivering an outstanding, customer-centric support experience is impossible without…
I want to share how to install osTicket v1.14 for Ubuntu 20.04 server. osTicket written…
Now I want to share how to install WordPress on ubuntu 20.04 server. WordPress is…