Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add() To throw an exception #10

Open
km3945 opened this issue Jan 18, 2017 · 0 comments
Open

add() To throw an exception #10

km3945 opened this issue Jan 18, 2017 · 0 comments

Comments

@km3945
Copy link

km3945 commented Jan 18, 2017

$bf = new BloomFilter(1, 0.01);
$key='foo';
$bf->add($key);
for ($i=0; $i<10000; $i++) {
	var_dump($bf->has($key.$i)); // bool(true)
	$bf->add($key.$i);
	var_dump($bf->has($key.$i)); // bool(true)
}
var_dump($bf->has($key)); // bool(true)

The first parameter is the number of nodes that can be inserted or the number of memory?
If the number of memory applications, how to calculate this value?

I want to insert data, the number of nodes or memory is not enough to throw an exception, so I can do the corresponding processing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant