Komihash explained in plain terms means understanding the speed demon that leaves rivals behind, a hash from 2020 that hashes short keys in about eight cycles and streams long ones at tens of gigabytes per second. The central question is why a hash would need to be that fast when computers are already quick, and the answer is that a hash table spends most of its time hashing, so a faster hash makes every lookup faster, and that leverage is the whole point of the design.
Komihash is a fast non-cryptographic hash function created by Aleksey Vaneev, producing a 64-bit digest. It turns a message into a fingerprint by feeding its words through seeded mixing steps built on products, splits and xors, and it is built on the idea that a hash should be tuned for the short keys that fill real tables, which means the design is meant for keys of a few bytes, and that focus is what makes it unlike the hashes of its era.
This article makes the case for Komihash, explains what it is, how it works, and where its ideas still earn their keep.
Key takeaways
- Komihash is a fast hash from 2020, created by Vaneev.
- It produces a 64-bit digest from any input.
- It hashes short keys in about eight cycles.
- It streams long data at around 27 gigabytes per second.
- It passed the SMHasher and SMHasher3 test suites.
What Komihash is
Komihash is a hash that turns a message into a fingerprint with seeded mixing, and that seeding is what makes it unusual among fast hashes. Each hash starts from a seed that changes the mixing, which means the same key gives a different fingerprint under a different seed, and because the seed is part of the design, the hash resists the collision attacks that plague unseeded hashes.
Its signature feature is its speed on short keys. Most hashes are tuned for long streams, but Komihash hashes a key of up to fifteen bytes in about eight cycles, which means the common case of a short lookup key is almost free, and because short keys are what fill real tables, the optimisation pays off everywhere.
The design was a reaction to the limits of the old fast hashes. The standard hashes of the previous decade were quick on long inputs but slow on short ones, so Vaneev built a hash that was fast at both, because a table does not care about averages, and that practicality is what made Komihash worth publishing.
It became one of the best-known fast hashes in the world, and it is named in every discussion of the field. Komihash streams long data at around 27 gigabytes per second, it passed the SMHasher and SMHasher3 suites, and it is still the first example engineers meet when they learn that short-key speed matters, which means the design survives as a benchmark even though newer hashes have arrived.
Its most famous property is its use of the digits of pi. The seed values of Komihash are drawn from the mantissa bits of pi, which means the constants have no hidden structure, and because pi is a public constant, nobody can suspect the designer of choosing them to hide a weakness.
Our guide to FarmHash explains the Google hash built for the same job, and our guide to HighwayHash explains the SIMD hash that took speed in a different direction.
How Komihash works
Everything starts with the seed, which is mixed into the initial state. Komihash takes the seed and folds it into two accumulators, which means the starting state depends on the seed, and because the seed is chosen by the caller, the same key gives a different hash in different tables.
Each step begins with the input words, which are read eight bytes at a time. Komihash takes the next two 64-bit words of the message and xors them with the running state, which means fresh data arrives at every step, and because the words are wide, the hash absorbs data quickly.
The mixing is what makes the design work as a whole. The two words are multiplied into a 128-bit product, and the halves are split and xored back into the state, which means the value is scrambled thoroughly, and because the product carries every input bit into every output bit, the mixing is complete in a single step.
The short-key path spreads the effect further. For keys of fifteen bytes or fewer, Komihash reads the key once and mixes it in a single pass, which means the common case skips the streaming machinery, and because the path is so short, the hash finishes in about eight cycles.
The finalisation is what turns the state into a digest. After the last word, Komihash mixes the length and the remaining bytes into the state and runs the mixing step once more, which means the digest depends on the whole message and nothing else, and because the final mix is the same as the mixing step, the design needs no special finishing step.
The digest comes from the final state, read out as a single 64-bit word. Komihash outputs the folded accumulator directly as the fingerprint, which means the result is a fixed size whatever the input, and that size is exactly what a hash table or a database index needs for its lookup key.

Comparing Komihash with other fast hashes
Komihash is one of several fast hashes built for hash tables, and each was built with a different emphasis. FarmHash is the Google hash built for the same job with a different mix, HighwayHash is the SIMD hash that uses vector instructions, and Komihash is the one tuned for short keys, while each approach trades something for something else.
The table below sets out the main contrasts between the leading approaches.
| Aspect | Komihash | FarmHash | HighwayHash |
|---|---|---|---|
| Core operation | Product, split, xor | Multiply and rotate | SIMD multiply |
| Digest size | 64 bits | 32, 64 or 128 bits | 64, 128 or 256 bits |
| Short-key speed | About 8 cycles | Tens of cycles | Tens of cycles |
| Year | 2020 | 2014 | 2017 |
| Best for | Short-key hash tables | General hashing | Vector-speed hashing |
The practical result is that Komihash is the right choice for short-key hash tables, FarmHash suits general hashing, and HighwayHash fits vector-speed hashing instead.
Where Komihash is used
Hash tables use it to spread keys with a wide fingerprint. A table that stores millions of short keys wants a hash that is both fast and well distributed, because a slow hash becomes the bottleneck, and that speed is the reason Komihash earns its keep in language runtimes.
Databases use it to fingerprint records quickly. A database that hashes short identifiers needs a hash that processes them in a few cycles, because a slow hash becomes the bottleneck, and that speed is the reason Komihash appears in data systems.
Benchmarking uses it as a speed reference. Engineers still quote Komihash when they discuss how fast a hash can run, because it is the clearest example of short-key tuning paying off, and that number shapes how new hashes are measured.
Caches use it to fingerprint keys quickly. A cache that hashes short strings needs a hash that finishes in a handful of cycles, because a slow hash becomes the bottleneck, and that width is the reason Komihash appears in high-performance systems.
Teaching uses it as the short-key example. Courses introduce Komihash when they explain that the common case deserves the optimisation, because it is the clearest case of the idea in a real design, and a student who understands Komihash understands why key length matters in hash design.
Strengths and limits
The greatest strength of Komihash is its speed on short keys. A hash that finishes in about eight cycles gives programs faster tables for free, and that strength is real, measured in open benchmarks and confirmed by the test suites it passed.
It is also a strength that the design is thoroughly tested. Komihash passed SMHasher and SMHasher3, and that testing is worth more than cleverness in a field where a hash with a hidden bias is a hash that fails in production.
The limits are real, though, and the biggest is that it is not cryptographic. Komihash was never designed to resist an adversary, which means it must never guard a secret or a signature, and a system that faces hostile inputs must use a keyed hash with stronger guarantees instead.
Komihash checklist
- Use Komihash for hash tables, never for security or passwords.
- Remember it hashes short keys in about eight cycles.
- Note the digest is 64 bits and the seeds come from pi.
- Compare it with FarmHash to see two kinds of fast design.
- Study the mixing step, which multiplies and splits.
- Check the version, since version 5 is the current one.
- Keep real digests behind standard hashes for signatures.
- Read the 2020 repository to see how it was built.
- Choose a keyed hash when inputs may be hostile.
Frequently asked questions
What is Komihash in simple terms?
It is a 2020 fast hash that turns any input into a 64-bit fingerprint by mixing seeded words through products, splits and xors.
Who created Komihash?
Aleksey Vaneev, who published it under the MIT licence as a faster alternative to the hashes in common use.
How is Komihash different from FarmHash?
Both are fast 64-bit hashes, but Komihash is tuned for short keys with a seeded mix while FarmHash is tuned for general use.
Is Komihash still secure?
It is fast and well tested, but it is not a cryptographic hash, so it must never guard secrets or signatures.
Where is Komihash used?
In hash tables, in databases, in caches, in benchmarking, and in teaching about short-key hash design.
When should I use Komihash?
When you need the fastest hash for short keys, when your inputs are trusted, or when you study seeded hash design.
The bottom line
Komihash explained in one line is this: the speed demon, a 2020 design that hashed short keys in eight cycles and taught the field that the common case is the case to optimise.
It is proof that tuning for reality beats tuning for benchmarks, and the reason it still matters is that every fast hash designed since has been judged partly by the lesson Komihash taught.
This article is general information about how Komihash works, not advice about choosing encryption for a particular device or system.







