【文件属性】:
文件名称:bloomfilter-rs:用Rust制造的Bloom Bloom过滤器
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-14 22:11:51
Rust
BloomFilter RS
用Rust写的Bloom过滤器。
上次使用Rust 1.1.0测试
例子
对于具有100个存储桶和5个哈希函数的Bloom过滤器:
let mut bf = BloomFilter :: new ( 100 , 5 );
bf. insert ( & "hamster" );
bf. insert ( & "coffee" );
bf. check ( & "hamster" );
// true
bf. check ( & "oatmeal" );
// (probably) false
bf. error_chance ();
// 0.000007804244
去做
多个哈希函数
error_chance()函数
处理插入任意类型
注意:我主要是建立这个专案来了解Rust的相关知识
【文件预览】:
bloomfilter-rs-master
----test()
--------test.rs(30B)
----src()
--------lib.rs(3KB)
----Cargo.toml(201B)
----.gitignore(18B)
----README.md(529B)