Documentation ¶
Index ¶
- Constants
- func Hash(b []byte) uint32
- func MemHash(data []byte) uint64
- func MemHashString(str string) uint64
- type BloomFilter
- func (f *BloomFilter) Allow(h uint32) bool
- func (f *BloomFilter) AllowKey(k []byte) bool
- func (f *BloomFilter) Insert(h uint32) bool
- func (f *BloomFilter) InsertKey(k []byte) bool
- func (f *BloomFilter) Len() int32
- func (f *BloomFilter) MayContain(h uint32) bool
- func (f *BloomFilter) MayContainKey(k []byte) bool
- type Cache
- type Filter
- type Options
Constants ¶
View Source
const ( STAGE_ONE = iota + 1 STAGE_TWO )
Variables ¶
This section is empty.
Functions ¶
func MemHashString ¶
MemHashString is the hash function used by go map, it utilizes available hardware instructions (behaves as aeshash if aes instruction is available). NOTE: The hash seed changes for every process. So, this cannot be used as a persistent hash.
Types ¶
type BloomFilter ¶
type BloomFilter struct {
// contains filtered or unexported fields
}
func (*BloomFilter) Allow ¶
func (f *BloomFilter) Allow(h uint32) bool
func (*BloomFilter) AllowKey ¶
func (f *BloomFilter) AllowKey(k []byte) bool
func (*BloomFilter) Insert ¶
func (f *BloomFilter) Insert(h uint32) bool
func (*BloomFilter) InsertKey ¶
func (f *BloomFilter) InsertKey(k []byte) bool
func (*BloomFilter) Len ¶
func (f *BloomFilter) Len() int32
func (*BloomFilter) MayContain ¶
func (f *BloomFilter) MayContain(h uint32) bool
MayContain returns whether the filter may contain given key. False positives are possible, where it returns true for keys not in the original set.
func (*BloomFilter) MayContainKey ¶
func (f *BloomFilter) MayContainKey(k []byte) bool
MayContainKey _
Click to show internal directories.
Click to hide internal directories.