Skip to content
/ bbhash Public

Implementation of the BBHash minimal perfect hash function

License

Notifications You must be signed in to change notification settings

relab/bbhash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

90 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BBHash

BBHash is a fast Go implementation of a minimal perfect hash function for large key sets.

Installing the package for use in your own project

% go get github.com/relab/bbhash

How to use the package

import (
	"fmt"

	"github.com/relab/bbhash"
)

func ExampleBBHash_Find() {
	keys := []uint64{1, 2, 3, 4, 5, 6, 7, 8, 9, 10}
	bb, err := bbhash.NewSequential(1.5, 0, keys)
	if err != nil {
		panic(err)
	}
	for _, key := range keys {
		hashIndex := bb.Find(key)
		fmt.Printf("%d, ", hashIndex)
	}
	fmt.Println()
	// Output:
	// 2, 6, 8, 3, 5, 7, 1, 9, 10, 4,
}

Credits

Implemented by Hein Meling.

The implementation is mainly inspired by Sudhi Herle's Go implementation. Damian Gryski also has a Go implementation.

The algorithm is described in the paper: Fast and Scalable Minimal Perfect Hashing for Massive Key Sets Antoine Limasset, Guillaume Rizk, Rayan Chikhi, and Pierre Peterlongo. Their C++ implementation is available here.

About

Implementation of the BBHash minimal perfect hash function

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published