-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
159 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package xorfilter | ||
|
||
type BinaryFuse8 BinaryFuse[uint8] | ||
|
||
// PopulateBinaryFuse8 fills the filter with provided keys. For best results, | ||
// the caller should avoid having too many duplicated keys. | ||
// The function may return an error if the set is empty. | ||
func PopulateBinaryFuse8(keys []uint64) (*BinaryFuse8, error) { | ||
filter, err := NewBinaryFuse[uint8](keys) | ||
if err != nil { | ||
return nil, err | ||
} | ||
|
||
return (*BinaryFuse8)(filter), nil | ||
} | ||
|
||
// Contains returns `true` if key is part of the set with a false positive probability of <0.4%. | ||
func (filter *BinaryFuse8) Contains(key uint64) bool { | ||
return (*BinaryFuse[uint8])(filter).Contains(key) | ||
} |
Oops, something went wrong.