mph

package
v0.0.0-...-6997cb8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const BBHashGamma = 10

BBHashGamma is as stated in the paper, the "best theoretical speed" is achieved with 2.

Variables

This section is empty.

Functions

This section is empty.

Types

type BBHash

type BBHash struct {
	// contains filtered or unexported fields
}

BBHash is hash function data.

func NewMinimalPerfectHash

func NewMinimalPerfectHash(keys []uint64) *BBHash

NewMinimalPerfectHash returns a new BBHash. It takes in the pre-hashed values as a parameter.

func (*BBHash) Find

func (bb *BBHash) Find(key uint64) uint64

Find is the function that returns the original index of the given key.

type ConstructedHashFunction

type ConstructedHashFunction struct {
	// contains filtered or unexported fields
}

A ConstructedHashFunction holds information about the built perfect hash function.

func Build

func Build(keys []string) *ConstructedHashFunction

Build builds a perfect hash function from keys using the "Hash, displace, and compress". Ref: http://cmph.sourceforge.net/papers/esa09.pdf.

func (*ConstructedHashFunction) Get

Get searches for s in t and returns its index.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL