<p>Murmur3 is a 32-bit hash function. All internal variables, as well as the seed and the output, are unsigned 32-bit integers. <code>uint32_t</code> arithmetic is modulo 2<sup>32</sup>.</p>
<p>Also note that BIP37 is all but dead.</p>

CC BY-SA 4.0
2021-09-23T12:44:51.687Z
Oh I see thanks, so what replaced bip37 for bloom filters?
Chiru
CC BY-SA 4.0
2021-09-23T12:53:48.603Z
It's not a direct replacement, but bip157.
Claris
CC BY-SA 4.0
2021-09-23T12:41:29.933Z
2021-09-23T13:19:48.603Z
2021-09-23T13:19:48.603Z
Pieter Wuille
<p>I'm trying to implement a seeded murmur3 hash using the bip37 standard for use in bloom filters.</p>
<p>In hash.cpp in bitcoin core, the seed is an unsigned int value. However my understanding of bip37 to determine a seed value is defined with the formula
<code>i * BIP37 Constant + Tweak</code>
where i iterates the number of functions.</p>
<p>Example, If i = 4, and Tweak = 100, this would lead to an overflow since it cannot be represented in a uint32?</p>
<p>I would be grateful for help, and to know if I need to use a 64-bit int for my seed.
Thanks.</p>

<hash><bip37-bloom-filter>
Size of seed used in murmur3 hash BIP0037
Chiru
# Size of seed used in murmur3 hash BIP0037

(Asked by: username_0 on 2021-09-23)

I'm trying to implement a seeded murmur3 hash using the bip37 standard for use in bloom filters.

In hash.cpp in bitcoin core, the seed is an unsigned int value. However my understanding of bip37 to determine a seed value is defined with the formula
`i * BIP37 Constant + Tweak`
where i iterates the number of functions.

Example, If i = 4, and Tweak = 100, this would lead to an overflow since it cannot be represented in a uint32?

I would be grateful for help, and to know if I need to use a 64-bit int for my seed.
Thanks.

**Tags:** hash, bip37-bloom-filter


---

## 1 answers

### Answer by username_1 on 2021-09-23. Score: 1

Murmur3 is a 32-bit hash function. All internal variables, as well as the seed and the output, are unsigned 32-bit integers. `uint32_t` arithmetic is modulo 232.

Also note that BIP37 is all but dead.

> **Comments:**
> **username_0**: Oh I see thanks, so what replaced bip37 for bloom filters?  
> **username_2**: It's not a direct replacement, but bip157.  

---

