SipHash-2-4 Calculator

Enter a 32-hex key and a message to compute its SipHash-2-4 digest.

How it is calculated

The tool runs SipHash-2-4 on the UTF-8 bytes of your message. The key must be exactly 32 hexadecimal characters (16 bytes); upper or lower case and surrounding spaces are accepted, and it is shown back in lower case. The message is split into 8-byte little-endian blocks, each mixed into the state with 2 rounds, the final block carries the message length, and 4 finalization rounds follow. The 64-bit result is written as 16 hex characters, most significant byte first. An empty key field falls back to 000102…0e0f; a message parameter that is absent entirely falls back to abc, while an empty message is hashed as zero bytes. A key of the wrong length or with non-hex characters returns no result. The length shown counts bytes, not characters.

Worked example

Use the key 000102030405060708090a0b0c0d0e0f and the message hello world. The message is 11 ASCII characters, so it is 11 bytes: one full 8-byte block plus 3 bytes of remainder, whose last block also encodes the length 11. After the compression and finalization rounds, the digest is ed5159c956cd5602. Changing a single character of the message, or one digit of the key, produces a completely different 16-character value.

Try this example →

Common mistakes

  • Using a key with fewer or more than 32 hex characters. A 16-byte key is required, and a passphrase or a 64-character key returns no result.
  • Treating the key as text. It is read as hex digits, so the string password is invalid, and 00 stands for one zero byte.
  • Comparing the digest with other tools without matching the byte order. This one prints the 64-bit value most significant byte first, whereas some libraries print the 8 bytes in memory order, which looks reversed.
  • Using SipHash-2-4 as a general-purpose password or file hash. It is a keyed hash for tables and message authentication of short inputs, and the 64-bit output is too short for collision resistance.
  • Forgetting that non-ASCII characters take several bytes. The text café is 5 bytes, and the length line reflects that.

About this calculator

SipHash-2-4 is a fast, keyed pseudorandom function designed by Jean-Philippe Aumasson and Daniel J. Bernstein specifically to defend hash tables against hash-flooding denial-of-service attacks — a technique where an attacker sends inputs deliberately chosen to collide in a hash table’s buckets, degrading lookups from O(1) to O(n) and stalling a server. The “2-4” refers to its round structure: 2 compression rounds per message block and 4 finalization rounds.

Given a 16-byte (128-bit) secret key and a message, it produces a 64-bit digest that’s cheap to compute but hard to predict without the key. This is why languages and systems including Python, Rust, Ruby and Redis use SipHash internally as the default hash function for strings and dictionary/hash-map keys. This calculator computes the SipHash-2-4 digest of any text under a given hex key, useful for developers verifying implementations or exploring how the algorithm behaves.

Was this helpful?

You can pick up to 3 reactions.

Comments (1)

  • Editorial team

    A handy sanity check for any SipHash-2-4 implementation is the empty message under the key 000102030405060708090a0b0c0d0e0f, which should give 726fdb47dd0e0e31 here. Reference test vectors often list the eight bytes in memory order, 31 0e 0e dd 47 db 6f 72, which is the same value read backwards. If your code disagrees, compare that case before looking at longer inputs. Which language or library are you checking against?

Popular calculators

All Calculators