A Go implementation of the Elias-Fano encoding
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
vendor/github.com/willf/bitset First implementation Sep 23, 2017
.gitignore Initial commit Sep 22, 2017
.travis.yml Changed travis config to exclude vendor Sep 23, 2017
Gopkg.lock First implementation Sep 23, 2017
Gopkg.toml First implementation Sep 23, 2017
LICENSE Initial commit Sep 22, 2017
README.md Added cover.run badge Sep 25, 2017
ef.go Fixed golint errors Sep 25, 2017
ef_test.go Fixed some bugs and added more tests Sep 24, 2017

README.md

go-ef

A Go implementation of the Elias-Fano encoding

Build Status GoDoc Go Report Card cover.run go

Example

package main
import (
    "fmt"
    "github.com/amallia/go-ef"
    "os"
)

func main() {
    array := []uint64{1,5,10}
    size := len(array)
    max := array[size-1]
    obj := ef.New(max, size)

    obj.Compress(array)

    v, err := obj.Next()
    if err != nil {
        fmt.Println(err)
        os.Exit(1)
    }
    fmt.Println(v) // 1

    obj.Next()
    fmt.Println(obj.Value()) // 5
}