gitwtfhub

wtf is xxhash?

cyan4973/xxhash — explained in plain English

Analysis updated 2026-06-24

11,011CAudience · developerComplexity · 2/5LicenseSetup · easy

TL;DR

Ultra-fast hashing library in C that turns data into fingerprints at speeds faster than RAM, built for non-security uses like integrity checks, hash tables, and duplicate detection.

Mindmap

mindmap
  root((xxHash))
    What it does
      Hashes data fast
      Produces fingerprints
      Detects changes
    Variants
      XXH32 32-bit
      XXH64 64-bit
      XXH3 128-bit
    Use cases
      Integrity checks
      Hash tables
      Duplicate detection
    Tech stack
      C language
      Single header
      BSD license

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Why would anyone build with this?

REASON 1

Check whether a file was corrupted during download by comparing its hash before and after transfer.

REASON 2

Build a fast key-value lookup table or cache using XXH3 hashes as bucket keys.

REASON 3

Detect duplicate files in a large collection by hashing each file and comparing results.

REASON 4

Speed up data deduplication in a backup or storage system without cryptographic overhead.

What's in the stack?

C

How it stacks up

cyan4973/xxhashfogleman/craftleandromoreira/ffmpeg-libav-tutorial
Stars11,01110,99910,967
LanguageCCC
Setup difficultyeasymoderatemoderate
Complexity2/53/53/5
Audiencedeveloperdeveloperdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you spin it up?

Difficulty · easy Time to first run · 5min
Use freely for any purpose including commercial products, as long as you keep the copyright and license notice.

Wtf does this do

xxHash is a hashing library written in C. A hash function takes a piece of data, such as a file or a string of text, and produces a short fixed-length number called a hash. That number acts like a fingerprint: if the data changes even slightly, the hash changes too. Hashes are used constantly in software for things like quickly checking whether data has been corrupted, looking things up in tables, or detecting duplicate files. What sets xxHash apart is speed. The README benchmarks show its fastest variant, XXH3, processing data at roughly 31 gigabytes per second on a modern desktop processor, which is faster than the rate at which that machine can read from RAM. Most well-known hash functions like MD5 or SHA1 are designed with security in mind and run far more slowly, xxHash is not a security tool and makes no claim to be, but for non-security uses (integrity checking, hash tables, caching) it is much faster. The library offers several variants. XXH32 produces a 32-bit hash suited to 32-bit processors, XXH64 produces a 64-bit hash for 64-bit systems, and XXH3 (introduced in version 0.8) produces either 64-bit or 128-bit hashes and is optimized for modern processors using a technique called vectorized arithmetic, which processes multiple values at once. All variants pass an independent test suite called SMHasher that evaluates quality properties such as how evenly the output values are distributed. The code is written in plain C, runs identically on processors with different byte orderings, and is available as either a single header file you drop into a project or a compiled library. It is free to use under a BSD-style license. The README is fairly technical, covering benchmark numbers, build configuration options, and integration instructions. The core use case is simple: any software that needs to hash data quickly and does not need cryptographic security.

Yoink these prompts

Prompt 1
Show me how to hash a string with xxHash's XXH3 64-bit function in C and print the result as a hex number.
Prompt 2
Write a C program that uses xxhash to check whether two files are identical without reading them byte by byte.
Prompt 3
How do I add xxhash as a single-header dependency in my CMake project and hash an arbitrary byte buffer?
Prompt 4
Compare the throughput of XXH32, XXH64, and XXH3 on a 10 MB buffer in C and print the timings side by side.
Prompt 5
Show me how to use xxhash to build a simple open-addressing hash map in C that maps string keys to integers.

Frequently asked questions

wtf is xxhash?

Ultra-fast hashing library in C that turns data into fingerprints at speeds faster than RAM, built for non-security uses like integrity checks, hash tables, and duplicate detection.

What language is xxhash written in?

Mainly C. The stack also includes C.

What license does xxhash use?

Use freely for any purpose including commercial products, as long as you keep the copyright and license notice.

How hard is xxhash to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is xxhash for?

Mainly developer.

View the repo → Decode another repo

This repo across BitVibe Labs

Don't trust strangers blindly. Verify against the repo.