1.安装
pip install bloom_filter
2. 简单使用
# coding=utf8 """ author:dengjiyun """ from bloom_filter import BloomFilter # 生成一亿个大小的 bloom=BloomFilter(max_elements=1000000000,error_rate=0.1) # 向bloom添加url bloom.add('https://www.tianyancha.com/company/23402373')
# 判断url 是否存在 res=bloom.__contains__('https://www.tianyancha.com/company/23402373') print(res) # 存在返回 True ,不存在 返回False
标签:www,https,res,布隆,BloomFilter,bloom,23402373 From: https://www.cnblogs.com/knighterrant/p/10923356.html