# Tls\_bloom\_filter - OTP's built-in Bloom filter you probably didn't know about

**URL:** <https://erlangforums.com/t/tls-bloom-filter-otps-built-in-bloom-filter-you-probably-didnt-know-about/5646>\
**Category:** Chat / Discussions\
**Tags:** erlang, library\
**Created:** [May 22, 2026, 3:11pm UTC](https://erlangforums.com/t/tls-bloom-filter-otps-built-in-bloom-filter-you-probably-didnt-know-about/5646 "2026-05-22T15:11:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zabrane](https://erlangforums.com/letter_avatar_proxy/v4/letter/z/7ba0ec/32.png) [@zabrane](https://erlangforums.com/u/zabrane)\
**Post date:** [May 22, 2026, 3:11pm UTC](https://erlangforums.com/t/tls-bloom-filter-otps-built-in-bloom-filter-you-probably-didnt-know-about/5646/1 "2026-05-22T15:11:11Z")

</div>

Following @etnt great [httpd\_router](https://erlangforums.com/t/httpd-router-a-routing-module-for-otps-built-in-httpd-web-server/5645) post (pure OTP gems are having a moment!), here’s one more: [tls\_bloom\_filter.erl](https://github.com/erlang/otp/blob/master/lib/ssl/src/tls_bloom_filter.erl), tucked away in lib/ssl/src/.

It powers `TLS 1.3` anti-replay protection, using a rotating pair of **Bloom filters** to detect already-seen 0-RTT binders. But look past the TLS context and you’ll find a clean, dependency free Bloom filter with configurable hash functions, bit-array sizes, and false positive rates.

Pure Erlang. Zero deps. Already on your machine.

Between this and @etnt [httpd\_router](https://erlangforums.com/t/httpd-router-a-routing-module-for-otps-built-in-httpd-web-server/5645), I’m starting to think we need a “Hidden Treasures of OTP” series. Who knows what else is lurking in there?

---

<div class="post-metadata">

**Author:** ![etnt](https://erlangforums.com/user_avatar/erlangforums.com/etnt/32/892_2.png) [@etnt](https://erlangforums.com/u/etnt)\
**Post date:** [May 22, 2026, 3:57pm UTC](https://erlangforums.com/t/tls-bloom-filter-otps-built-in-bloom-filter-you-probably-didnt-know-about/5646/2 "2026-05-22T15:57:10Z")

</div>

Just to be clear and avoid any confusion 🙂 , httpd\_router is not part of OTP,  
but perhaps it should? If it was part of OTP (it’s really just one file), then it  
would be easy to quickly whip up a nice HTTP API without having to import  
any dependencies; often that can be good enough (example usage can be  
found in edbg which sets up an API for serving its MCP server).
