Miklix

Fowler-Noll-Vo FNV1a-64 Hash Code Calculator

Published: February 10, 2025 at 4:34:37 PM UTC

Hash code calculator that uses the Fowler-Noll-Vo 1a 64 bit (FNV1a-64) hash function to calculate a hash code based on text input or file upload.

The FNV-1a 64-bit hash function is part of the Fowler–Noll–Vo (FNV) family of hash functions, designed for fast hashing while maintaining a good distribution of hash values. It is commonly used in applications like hash tables, checksums, and data lookups. It produces a 64 bit (8 byte) hash code, often represented as a 16 digit hexadecimal number.

The FNV-1a variant is an improved version over the original FNV-1 function with better security.

Full disclosure: I did not write the specific implementation of the hash function used on this page. It is a standard function included with the PHP programming language. I only made the web interface to make it publicly available here for convenience.


Calculate New Hash Code

Data submitted or files uploaded through this form will only be kept on the server for as long as it takes to generate the requested hash code. It will be deleted immediately before the result is returned to your browser.

Input data:



Submitted text is UTF-8 encoded. Since hash functions operate on binary data, the result will be different than if the text was in another encoding. If you need to calculate a hash of a text in a specific encoding, you should upload a file instead.



About the Fowler-Noll-Vo FNV-1a 64 bit Hash Algorithm

I'm not a mathematician, but I'll try to explain this hash function using an analogy that my fellow non-mathematicians can understand. If you prefer a scientifically correct, scary-math explanation, I'm sure you can find that elsewhere ;-)

First, let's think of the FNV-1 algorithm like a recipe for making a special smoothie. Each ingredient you add (like fruits, milk, or honey) represents a piece of data - like letters, numbers, or even an entire file.

Now, the goal is to mix these ingredients in a very specific way so that even the tiniest change in the recipe (like adding one extra blueberry) makes the smoothie taste completely different. That's how hash functions work - they create a unique "flavor" (or hash value) for every unique set of ingredients (or input data).

The way the FNV-1 algorithm does this is a multi-step process:

Step 1: Start with a Base (Offset Basis)

Think of this like pouring a special smoothie base into your blender. This base is always the same, no matter what ingredients you add. In FNV-1, this is called the "offset basis" - just a fancy starting number.

Step 2: Add Ingredients One by One (Processing Data)

Now you start adding your ingredients, one at a time - let's say a strawberry, then a banana, then some honey. Each of these represents a byte of data.

Step 3: Blend with a Secret Multiplier (The FNV Prime)

After adding each ingredient, you hit the blend button, but here's the twist: the blender multiplies everything by a secret "magic number" called the FNV prime. This helps mix things up really well.

Step 4: Add a Dash of Magic (XOR Operation)

Before adding the next ingredient, you sprinkle in a little magic dust (this is the XOR operation). It's like flipping the flavor in unexpected ways, ensuring even small changes make a big difference.

Step 5: Repeat Until Done

You keep blending and sprinkling magic after each new ingredient until you've processed everything.

Step 6: Final Smoothie (Hash Value)

When you're done, you pour out the smoothie. The final taste (the hash value) is unique to that exact combination of ingredients. If you had added even one extra blueberry, it would taste completely different.

The version presented here is the improved FNV-1a 64 bit version. If you need the original version, I also have a calculator for that: Fowler-Noll-Vo FNV1-64 Hash Code Calculator

Share on BlueskyShare on FacebookShare on LinkedInShare on TumblrShare on XShare on LinkedInPin on Pinterest

Mikkel Bang Christensen

About the Author

Mikkel Bang Christensen
Mikkel is the creator and owner of miklix.com. He has over 20 years experience as a professional computer programmer/software developer and is currently employed full-time for a large European IT corporation. When not blogging, he spends his spare time on a vast array of interests, hobbies, and activities, which may to some extent be reflected in the variety of topics covered on this website.