MurmurHash3 (32-bit) is a fast non-cryptographic hash built from two stages: each 4-byte block is mixed into an accumulator h1 , then a finalizer avalanches the result so one changed bit rewrites half the output. Used for hash tables and bloom filters . The seed picks an independent hash function — test with seed 0 gives 0xBA6BD213 .
Implementations disagree on signedness, not on the bits — Java's murmur3_32 returns the signed reading of the same 32 bits.
| Stage | Bytes | k1 | h1 |
|---|---|---|---|
| seed | — | — | 0x00000000 |
| ^= len (0) | — | — | 0x00000000 |
| ^= h1 >>> 16 | — | — | 0x00000000 |
| *= 0x85EBCA6B | — | — | 0x00000000 |
| ^= h1 >>> 13 | — | — | 0x00000000 |
| *= 0xC2B2AE35 | — | — | 0x00000000 |
| ^= h1 >>> 16 | — | — | 0x00000000 |
Each block mixes k1 (×c1, rotl 15, ×c2), XORs it into h1, then rotates and scrambles h1. The tail skips that rotation, and the six finalization steps run once at the end — that last group is what turns a near-collision into an unrelated number.
| Name | Value | Used for |
|---|---|---|
| c1 | 0xCC9E2D51 | first k1 multiply |
| rotl 15 | 15 | k1 rotate, between the multiplies |
| c2 | 0x1B873593 | second k1 multiply |
| rotl 13 | 13 | h1 rotate, after each block |
| m, n | 5, 0xE6546B64 | h1 = h1 × m + n, per block |
| fmix c1 | 0x85EBCA6B | first finalization multiply |
| fmix c2 | 0xC2B2AE35 | second finalization multiply |
That is the real hash of an empty message — with seed 0 it is exactly 0x00000000, because the finalizer has nothing but zeros to avalanche. Type something to fill the trace.
MurmurHash3 is built for speed and distribution, not for security. It is not collision-resistant against an attacker who picks the input — never use it for passwords, signatures, or integrity checks.
marduc812
© 202620260812_d5568b8